#include <bits/stdc++.h>
using namespace std;
int main(){
    long long N;
    cin >> N;
    vector<int> ans;
    long long INF = 1000000000000000000;
    vector<long long> fib(87, INF);
    fib[0] = 1;
    fib[1] = 1;
    for(int i = 2; i < 87; i++){
        fib[i] = fib[i - 1] + fib[i - 2];
    }
    vector<int> ind;
    while(N > 0){
        for(int i = 86; i >= 0; i--){
            if(N >= fib[i]) {
                N -= fib[i];
                ind.push_back(86 - i);
                break;
            }
        }
    }
    int id = 0;
    for(int i = 0; i < 86; i++){
        if(i > 0){
            if(i % 2 == 0){
                ans.push_back(3);
            }
            else{
                ans.push_back(4);
            }
        }
        while(id < ind.size() && ind[id] == i){
            if(i % 2 == 0){
                ans.push_back(1);
            }
            else ans.push_back(2);
            id++;
        }
    }
    long long x = 0, y = 0;
    ans.push_back(3);
    for(int i = 0; i < ans.size(); i++){
        if(ans[i] == 1) x++;
        else if(ans[i] == 2) y++;
        else if(ans[i] == 3) x = x + y;
        else y = x + y;
    }
    cout << ans.size() << endl;
    for(int t: ans) cout << t << endl;
}
#include <bits/stdc++.h>
// clang-format off
using namespace std; using ll=long long; using ull=unsigned long long; using pll=pair<ll,ll>; const ll INF=4e18;
void print0(){}; template<typename H,typename... T> void print0(H h,T... t){cout<<h;print0(t...);}
void print(){print0("\n");}; template<typename H,typename... T>void print(H h,T... t){print0(h);if(sizeof...(T)>0)print0(" ");print(t...);}
void perr0(){}; template<typename H,typename... T> void perr0(H h,T... t){cerr<<h;perr0(t...);}
void perr(){perr0("\n");}; template<typename H,typename... T>void perr(H h,T... t){perr0(h);if(sizeof...(T)>0)perr0(" ");perr(t...);}
void ioinit() { cout << fixed << setprecision(15); cerr<<fixed<<setprecision(6); ios_base::sync_with_stdio(0); cin.tie(0); }
// clang-format on

ll fibrest(ll x0, ll y0, ll n, bool isx) {
    ll iter = 0;
    vector<ll> fib = {x0, y0};
    ll x = x0;
    ll y = y0;
    ll op = 0;
    while (true) {
        if (isx) {
            x = x + y;
        } else {
            y = y + x;
        }
        if (x >= n) break;
        op++;
        isx = !isx;
    }
    return op;
}
void op(vector<ll> &ops, ll &x, ll &y, ll t) {
    if (t == 1) {
        x = x + 1;
    }
    if (t == 2) {
        y = y + 1;
    }
    if (t == 3) {
        x = x + y;
    }
    if (t == 4) {
        y = y + x;
    }
    ops.push_back(t);
}
void output(vector<ll> &ops) {
    ll k = ops.size();
    print(ops.size());
    for (auto ope : ops) {
        print(ope);
    }
}

int main() {
    ioinit();

    ll n;
    cin >> n;
    // while (fib.back() < n) {
    //     fib.push_back(fib[fib.size() - 1] + fib[fib.size() - 2]);
    // }
    // ll m = fib.size();

    ll x = 0;
    ll y = 0;

    vector<ll> ops;
    if (n < 120) {
        while (x < n) {
            op(ops, x, y, 1);
        }
        output(ops);
        return 0;
    }

    op(ops, x, y, 2);
    bool isx = true;
    while (true) {
        if (x + y > n) {
            while (x < n) {
                op(ops, x, y, 1);
            }
            break;
        }
        ll curop = fibrest(x, y, n, isx);

        {
            ll k = 0;
            while (true) {
                ll r = fibrest(x + k + 1, y, n, isx);
                if (r != curop) break;
                //perr(curop, r);
                op(ops, x, y, 1);
                k = k + 1;
            }
        }
        if (isx) {
            op(ops, x, y, 3);
        } else {
            op(ops, x, y, 4);
        }
        isx = !isx;
        if (x >= n) break;
    }
    output(ops);
}
