from math import*

def U(n):
    x=3
    y=1
    for i in range(1,n+1):
        X=2*x+y+4
        y=3*x-y-1
        x=X
    return(x,y)


