// editor3
#include<stdio.h>
int main()
{
    int limit;
    scanf("%d", &limit);
    if(limit < 0)
    {
        printf("Invalid input\n");
        return 0;
    }
    int a=0, b=1,c;
    if(limit >= 0)
    {
        printf("0 ");
    }
    if(limit >= 1)
    {
        printf("1");
    }
    c = a+b;
    while(c <= limit)
    {
        printf(" %d ",c);
        a=b;
        b=c;
        c=a+b;
    }
    printf("");
    return 0;
}