#include <bits/stdc++.h>
using namespace std;
int _ = (cout << fixed << setprecision(9), cin.tie(0), ios::sync_with_stdio(0));
using Int = long long;
int main() {
    Int N; cin >> N;
    const int M = 44;
    vector<Int> X(M), Y(M);
    for (int i = 0; i < M; i++) {
        // X = X + 1
        X[i] = 1;
        if (i + 1 == M) break;
        // Y = X + Y
        for (int j = 0; j < M; j++) {
            Y[j] += X[j];
        }
        // X = X + Y
        for (int j = 0; j < M; j++) {
            X[j] += Y[j];
        }
    }
    vector<Int> A(M);
    for (int i = 0; i < M; i++) {
        while (X[i] <= N) {
            A[i]++;
            N -= X[i];
        }
    }
    vector<int> op;
    for (int i = 0; i < M; i++) {
        for (int j = 0; j < A[i]; j++) {
            op.push_back(1);
        }
        if (i + 1 == M) break;
        op.push_back(4);
        op.push_back(3);
    }
    cout << op.size() << '\n';
    for (auto x : op) cout << x << '\n';
    return 0;
}

#include <bits/stdc++.h>

int ri() {
	int n;
	scanf("%d", &n);
	return n;
}


template<int mod>
struct ModInt{
	int x;
	ModInt () : x(0) {}
	ModInt (int64_t x) : x(x >= 0 ? x % mod : (mod - -x % mod) % mod) {}
	ModInt &operator += (const ModInt &p){
		if ((x += p.x) >= mod) x -= mod;
		return *this;
	}
	ModInt &operator -= (const ModInt &p) {
		if ((x += mod - p.x) >= mod) x -= mod;
		return *this;
	}
	ModInt &operator *= (const ModInt &p) {
		x = (int64_t) x * p.x % mod;
		return *this;
	}
	ModInt &operator /= (const ModInt &p) {
		*this *= p.inverse();
		return *this;
	}
	ModInt &operator ^= (int64_t p) {
		ModInt res = 1;
		for (; p; p >>= 1) {
			if (p & 1) res *= *this;
			*this *= *this;
		}
		return *this = res;
	}
	ModInt operator - () const { return ModInt(-x); }
	ModInt operator + (const ModInt &p) const { return ModInt(*this) += p; }
	ModInt operator - (const ModInt &p) const { return ModInt(*this) -= p; }
	ModInt operator * (const ModInt &p) const { return ModInt(*this) *= p; }
	ModInt operator / (const ModInt &p) const { return ModInt(*this) /= p; }
	ModInt operator ^ (int64_t p) const { return ModInt(*this) ^= p; }
	bool operator == (const ModInt &p) const { return x == p.x; }
	bool operator != (const ModInt &p) const { return x != p.x; }
	explicit operator int() const { return x; }
	ModInt &operator = (const int p) { x = p; return *this;}
	ModInt inverse() const {
		int a = x, b = mod, u = 1, v = 0, t;
		while (b > 0) {
			t = a / b;
			a -= t * b;
			std::swap(a, b);
			u -= t * v;
			std::swap(u, v);
		}
		return ModInt(u);
	}
	friend std::ostream & operator << (std::ostream &stream, const ModInt<mod> &p) {
		return stream << p.x;
	}
	friend std::istream & operator >> (std::istream &stream, ModInt<mod> &a) {
		int64_t x;
		stream >> x;
		a = ModInt<mod>(x);
		return stream;
	}
};
typedef ModInt<1000000007> mint;

template<int mod> struct MComb {
	using mint = ModInt<mod>;
	std::vector<mint> fact;
	std::vector<mint> inv;
	MComb (int n) { // O(n + log(mod))
		fact = std::vector<mint>(n + 1, 1);
		for (int i = 1; i <= n; i++) fact[i] = fact[i - 1] * mint(i);
		inv.resize(n + 1);
		inv[n] = fact[n] ^ (mod - 2);
		for (int i = n; i--; ) inv[i] = inv[i + 1] * mint(i + 1);
	}
	mint ncr(int n, int r) {
		return fact[n] * inv[r] * inv[n - r];
	}
	mint npr(int n, int r) {
		return fact[n] * inv[n - r];
	}
	mint nhr(int n, int r) {
		assert(n + r - 1 < (int) fact.size());
		return ncr(n + r - 1, r);
	}
};


int main() {
	int64_t n;
	std::cin >> n;
	int T = 87;
	int64_t fib[T];
	fib[0] = fib[1] = 1;
	for (int i = 2; i < T; i++) fib[i] = fib[i - 1] + fib[i - 2];
	
	std::vector<int> demand;
	for (int i = T; i--; ) {
		if (n >= fib[i]) n -= fib[i], demand.push_back(i);
	}
	
	int top = demand.front();
	demand.erase(demand.begin());
	
	std::vector<int> res;
	for (int i = 0; i <= top; i++) {
		int command;
		if (i == 0) command = 1;
		else if (i == 1) command = 2;
		else command = ((top ^ i) & 1) ? 4 : 3;
		
		res.push_back(command);
		if (std::count(demand.begin(), demand.end(), top - i)) res.push_back(command == 4 ? 2 : 1);
	}
	
	printf("%d\n", (int) res.size());
	for (auto i : res) printf("%d\n", i);
	
	/*
	int64_t x = 0;
	int64_t y = 0;
	for (auto i : res) {
		if (i == 1) x++;
		else if (i == 2)y++;
		else if (i == 3) x += y;
		else y += x;
	}
	printf("%" PRId64 " %" PRId64 "\n", x, y);*/
	
	return 0;
}
