
#include <algorithm>
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <cstdint>
#include <cmath>
#include <iostream>
#include <iomanip>
#include <map>
#include <set>
#include <queue>
#include <vector>

using namespace std;

constexpr static int MAXK = 130;

void solve() {
    int64_t n;
    cin >> n;

    if (n <= 100) {
        vector <int> r;
        for (int i = 0; i < n; i++)
            r.push_back(1);

        cout << r.size() << '\n';
        for (int x : r)
            cout << x << '\n';
        return;
    }

    vector <int64_t> fib;
    fib.push_back(1);
    fib.push_back(1);
    while (fib.back() <= n) {
        int m = fib.size();
        fib.push_back(fib[m - 2] + fib[m - 1]);
    }
    fib.pop_back();

    int m = fib.size();
    vector <int> need(m);
    int64_t left = n;
    for (int i = m - 1; i >= 0; i--) {
        if (left >= fib[i]) {
            left -= fib[i];
            need[i] = 1;
            // cout << left << ' ' << fib[i] << endl;
        }
    }
    /*
    cout << "need:";
    for (int i = 0; i < m; i++)
        if (need[i])
            cout << ' ' << i;
    cout << " | " << m << endl;
    */

    int64_t x = 1;
    int64_t y = 1;
    vector <int> r;
    r.push_back(1);
    r.push_back(2);
    for (int i = 1; i < m; i++) {
        if (need[m - i - 1]) {
            // cout << x << ' ' << y << endl;
            if (i % 2 == 0)
                y++, r.push_back(2);
            else
                x++, r.push_back(1);
        }

        // cout << x << ' ' << y << endl;
        if (i % 2 == 0)
            x += y, r.push_back(3);
        else
            y += x, r.push_back(4);
    }

    assert(x == n || y == n);
    if (y == n) {
        for (int i = 0; i < r.size(); i++) {
            if (r[i] == 1) r[i] = 2;
            else if (r[i] == 2) r[i] = 1;
            else if (r[i] == 3) r[i] = 4;
            else if (r[i] == 4) r[i] = 3;
        }
    }
    cout << r.size() << '\n';
    for (int i : r)
        cout << i << '\n';

    // check
    x = 0;
    y = 0;
    for (int i : r) {
        if (i == 1) x++;
        if (i == 2) y++;
        if (i == 3) x += y;
        if (i == 4) y += x;
        // cout << x << ' ' << y << endl;
    }
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    solve();
}

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <bitset>
using namespace std;

#ifdef LOCAL
	#define eprintf(...) fprintf(stderr, __VA_ARGS__);fflush(stderr);
#else
	#define eprintf(...) 42
#endif

using ll = long long;
using ld = long double;
using uint = unsigned int;
using ull = unsigned long long;
template<typename T>
using pair2 = pair<T, T>;
using pii = pair<int, int>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll myRand(ll B) {
	return (ull)rng() % B;
}

#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second

clock_t startTime;
double getCurrentTime() {
	return (double)(clock() - startTime) / CLOCKS_PER_SEC;
}

using Int = __int128;

long double phi = (sqrtl(5) + 1) / 2;
vector<int> ans;

bool tooBig(Int x, Int y) {
	return (2 * x - y) * (2 * x - y) > 5 * y * y;
}

int main()
{
	startTime = clock();
//	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);

	ll x;
	scanf("%lld", &x);
	ll l = 0, r = x;
	while(r - l > 1) {
		ll y = (l + r) / 2;
		if (tooBig(x, y))
			l = y;
		else
			r = y;
	}
	ll y = l;
	while(x > 0 && y > 0) {
		if (x > y) {
			
			while(tooBig(x - 1, y)) {
				ans.push_back(1);
				x--;
			}
			
			ans.push_back(3);
			x -= y;
		} else {
			
			while(tooBig(y - 1, x)) {
				ans.push_back(2);
				y--;
			}
			
			ans.push_back(4);
			y -= x;
		}
	}
	while(x > 0) {
		ans.push_back(1);
		x--;
	}
	while(y > 0) {
		ans.push_back(2);
		y--;
	}
	//assert((int)ans.size() < 130);
	reverse(all(ans));
	printf("%d\n", (int)ans.size());
	for (int x : ans)
		printf("%d\n", x);

	return 0;
}
