#include<stdio.h>
int main()
{
    int t1=0,t2=1,nextTerm=0;
    scanf("%d", &n);
    if(n<0)
    {
        printf("Invalid input");
    }
    else
    {
        printf("%d %d",t1, t2);
        nextTerm = t1 + t2;
        whlie(nextTerm <= n)
        {
            printf("%d ",nextTerm);
            t1 = t2;
            t2 = nextTerm;
            nextTerm = t1 + t2;
        }
    }
    return 0;
}