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