// editor5
#include<iostream>
using namespace std;
int main(){
    int limit;
    cin >> limit;
    if (limit < 0){
        cout << "Invalid input";
    }
    else{
        int a = 0, b = 1;
        cout << a;
        if (limit >= 1)
        cout << " "  << b;
        int next = a + b;
        while (next <= limit ){
            cout << " " << next;
            a = b;
            b = next;
            next = a + b
        }
    }
    return 0;
}