# 方法1
def fib(n):
    a, b = 0, 1
    while a < n:
        print(a, end=' ')
        a, b = b, a+b
    print()
fib(1000)  # 取值范围可以任意

# 输出结果如下：
# 0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987

# 方法2
#斐波那契数列的通项式为:f(n) = (5**0.5/5)*(((1+5**0.5)/2)**n - ((1-5**0.5)/2)**n)

N = int(input("请输入要几项:"))
if(N < 0):
    print("请输入大于0的数")
else:
    for i in range(0,N):
        print(int((5**0.5/5)*(((1+5**0.5)/2)**i - ((1-5**0.5)/2)**i)))