#include <bits/stdc++.h>
using namespace std;
#ifdef tabr
#include "library/debug.cpp"
#else
#define debug(...)
#endif

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    long long n;
    cin >> n;
    long long m = n;
    vector<long long> f(88);
    f[0] = f[1] = 1;
    for (int i = 2; i < (int) f.size(); i++) {
        f[i] = f[i - 1] + f[i - 2];
    }
    debug(f);
    vector<int> a(87);
    int k = 0;
    for (int i = 87; i >= 0; i--) {
        if (n >= f[i]) {
            n -= f[i];
            k = max(k, i);
            a[k - i] = 1;
        }
    }
    vector<int> res;
    long long x = 0, y = 0;
    for (int i = 0; i <= k; i++) {
        if (a[i]) {
            res.emplace_back(i % 2);
            if (i % 2 == 0) {
                x++;
            } else {
                y++;
            }
        }
        if (i != k) {
            res.emplace_back(3 - i % 2);
            if (i % 2 == 0) {
                y += x;
            } else {
                x += y;
            }
        }
    }
    debug(x, y);
    if (y == m) {
        for (int i = 0; i < (int) res.size(); i++) {
            res[i] ^= 1;
        }
    }
    cout << res.size() << '\n';
    for (int i : res) {
        cout << i + 1 << '\n';
    }
    return 0;
}
#include <bits/stdc++.h>
using namespace std;
#define SZ(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define loop(i, a) for (int i = 0; i < (a); ++i)
#define cont(i, a) for (int i = 1; i <= (a); ++i)
#define circ(i, a, b) for (int i = (a); i <= (b); ++i)
#define range(i, a, b, c) for (int i = (a); (c) > 0 ? i <= (b) : i >= (b); i += (c))
#define parse(it, x) for (auto &it : (x))
#define pub push_back
#define pob pop_back
#define emb emplace_back
#define mak make_pair
#define mkt make_tuple
typedef long long ll;
typedef long double lf;
const int Inf = 0x3f3f3f3f;
const ll INF = 0x3f3f3f3f3f3f3f3fll;

mt19937_64 Rand(chrono::steady_clock::now().time_since_epoch().count());
ll n;

ll calc(ll x) {
    ll y = n;
    ll cs = 0;
    while (y) {
        cs += x / y;
        x %= y;
        swap(x, y);
    }
    return cs + x;
}

int main() {
    cin >> n;
    while (1) {
        ll m = uniform_int_distribution<ll>(0, n)(Rand);
        if (calc(m) <= 130) {
            ll x = n, y = m;
            vector<int> ans;
            while (x && y) {
                if (x < y) {
                    y -= x;
                    ans.pub(4);
                }
                else {
                    x -= y;
                    ans.pub(3);
                }
            }
            while (x) --x, ans.pub(1);
            while (y) --y, ans.pub(2);
            reverse(all(ans));
            printf("%d\n", SZ(ans));
            parse(i, ans) printf("%d\n", i);
            return 0;
        }
    }
}