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