#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;

const long double phi = 0.618033988749894848204586834365; 

vector<int> calc(long long x, long long y) {
	vector<int> a;
	while (x > 0 || y > 0) {
		if (a.size() > 130) {
			break;
		}
		if (x == 0) {
			a.push_back(2);
			y -= 1;
			continue;
		}

		if (y == 0) {
			a.push_back(1);
			x -= 1;
			continue;
		}

		if (x > y) {
			a.push_back(3);
			x -= y;
			continue;
		}
	
		a.push_back(4);
		y -= x;
	}
	
	reverse(a.begin(), a.end());
	return a;
}	

int main() {
	long long x;
	scanf("%lld", &x);
	long double yd = x * phi;
	long long y = (long long)(yd);
	if (yd - (long long)(yd) >= 0.5) {
		y = (long long)(yd) + 1;
	}

	vector<int> a;
	for (int i = -10000; i <= 10000; ++i) {
		if (y + i < 0) {
			continue;
		}

		a = calc(x, y + i);
		if (a.size() <= 130) {
			break;
		}
	}

	printf("%d\n", a.size());
	for (int i = 0; i < a.size(); ++i) {
		printf("%d\n", a[i]);
	}
	return 0;
}

#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <climits>
#include <cstring>
#include <cassert>


using namespace std;
//using namespace atcoder;

#define REP(i, n) for (int i=0; i<(n); ++i)
#define RREP(i, n) for (int i=(int)(n)-1; i>=0; --i)
#define FOR(i, a, n) for (int i=(a); i<(n); ++i)
#define RFOR(i, a, n) for (int i=(int)(n)-1; i>=(a); --i)

#define SZ(x) ((int)(x).size())
#define ALL(x) (x).begin(),(x).end()

#define DUMP(x) cerr<<#x<<" = "<<(x)<<endl
#define DEBUG(x) cerr<<#x<<" = "<<(x)<<" (L"<<__LINE__<<")"<<endl;

template<class T>
ostream &operator<<(ostream &os, const vector<T> &v) {
    os << "[";
    REP(i, SZ(v)) {
        if (i) os << ", ";
        os << v[i];
    }
    return os << "]";
}

template<class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
    return os << "(" << p.first << " " << p.second << ")";
}

template<class T>
bool chmax(T &a, const T &b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

template<class T>
bool chmin(T &a, const T &b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}

using ll = long long;
using ull = unsigned long long;
using ld = long double;
using P = pair<int, int>;
using vi = vector<int>;
using vll = vector<ll>;
using vvi = vector<vi>;
using vvll = vector<vll>;

const ll MOD = 1e9 + 7;
const int INF = INT_MAX / 2;
const ll LINF = LLONG_MAX / 2;
const ld eps = 1e-9;

ull rnd(void) {
    static ull y = 2463534242;
    y = y ^ (y << 13);
    y = y ^ (y >> 17);
    return y = y ^ (y << 5);
}

// edit
ll LIM = 130;

int rec(ll x, ll y) {
    if (x == 0 && y == 0) {
        return 0;
    }
    if (x == y) {
        return x + y;
    }
    if (x == 0) {
        return y;
    }
    if (y == 0) {
        return x;
    }
    if (x > y) {
//        return 1 + rec(x - y, y);
        if (x / y > LIM) return INF;
        return 1 + rec(x - y, y);
    }
    if (x < y) {
        if (y / x > LIM) return INF;
        return 1 + rec(x, y - x);
    }

    return INF;
}

void solver(ll x, ll y, vector<int> &O) {
    if (x == y) {
        if (x == 0) return;
        REP(i, x) {
            O.push_back(1);
        }
        REP(i, y) {
            O.push_back(2);
        }
    }
    if (x == 0) {
        REP(i, y) {
            O.push_back(2);
        }
    }
    if (y == 0) {
        REP(i, x) {
            O.push_back(1);
        }
    }
    if (x > y) {
        O.push_back(3);
        solver(x - y, y, O);
    }
    if (x < y) {
        O.push_back(4);
        solver(x, y - x, O);
    }
}

void solve() {
//    ll N = 100;
//    REP(i, N) {
//        cout << i << " " << rec(N, i) << endl;
//    }
    ll N;
    cin >> N;
    if (N == 1) {
        cout << 1 << endl;
        cout << 1 << endl;
        return;
    }
    ll y;
    while (true) {
        y = rnd() % (N - 1) + 1;
        ll val = rec(N, y);
        if (val <= LIM) {
//            cout << val << endl;
            break;
        } else {
//            cerr << y << " " << val << endl;
        }
    }

    vector<int> ans;
    solver(N, y, ans);
    assert(ans.size() <= LIM);
    reverse(ALL(ans));

    cout << ans.size() << endl;
    for (auto e : ans) {
        cout << e << endl;
    }


}


int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
//    std::ifstream in("input.txt");
//    std::cin.rdbuf(in.rdbuf());

    solve();


    return 0;
}
