a,b=2,1

for i in[0]*int(eval(input())):a,b=b,a+b

print(a)
a,b=2,1

for i in[0]*eval(input()):a,b=b,a+b

print(a)
a, b = 2, 1
for i in [0] * int(eval(input())):
    a, b = b, a + b
print(a)

a, b = 2, 1
for i in [0] * eval(input()):
    a, b = b, a + b
print(a)

-for i in [0] * int(eval(input())): +for i in [0] * eval(input()):