N=int(eval(input()))

lst=[2,1]

for i in range(2,N+1):

    lst.append(lst[i-1]+lst[i-2])

print((lst[N]))
N=int(eval(input()))

lucas=[2,1]

for i in range(2,N+1):

    lucas.append(lucas[i-1]+lucas[i-2])



print((lucas[N]))
N = int(eval(input()))
lst = [2, 1]
for i in range(2, N + 1):
    lst.append(lst[i - 1] + lst[i - 2])
print((lst[N]))

N = int(eval(input()))
lucas = [2, 1]
for i in range(2, N + 1):
    lucas.append(lucas[i - 1] + lucas[i - 2])
print((lucas[N]))

-lst = [2, 1] +lucas = [2, 1] -    lst.append(lst[i - 1] + lst[i - 2]) -print((lst[N])) +    lucas.append(lucas[i - 1] + lucas[i - 2]) +print((lucas[N]))