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