#Generating Fibonacci series

a,b=0,1

#Upto N terms

n=int(input())-2	#remaining n terms 

print('%d\n%d'%(a,b))

while n != 0 :
	a,b=b,a+b
	print(b)
	n-=1

#Upto max term

a,b=0,1

m=int(input())	#max value 

print('%d\n%d'%(a,b))

while True :
	a,b=b,a+b
	if b>m:
		break
	print(b)


d89a8297c5067c4a1dd9062be557d287197db4c9
<mask token>

<mask token>
print('%d\n%d' % (a, b))
while n != 0:
    a, b = b, a + b
    print(b)
    n -= 1
<mask token>
print('%d\n%d' % (a, b))
while True:
    a, b = b, a + b
    if b > m:
        break
    print(b)

a, b = 0, 1
n = int(input()) - 2
print('%d\n%d' % (a, b))
while n != 0:
    a, b = b, a + b
    print(b)
    n -= 1
a, b = 0, 1
m = int(input())
print('%d\n%d' % (a, b))
while True:
    a, b = b, a + b
    if b > m:
        break
    print(b)

#Generating Fibonacci series

a,b=0,1

#Upto N terms

n=int(input())-2	#remaining n terms 

print('%d\n%d'%(a,b))

while n != 0 :
	a,b=b,a+b
	print(b)
	n-=1

#Upto max term

a,b=0,1

m=int(input())	#max value 

print('%d\n%d'%(a,b))

while True :
	a,b=b,a+b
	if b>m:
		break
	print(b)

