#include<bits/stdc++.h>
using namespace std;

#define ll long long
#define mem(x) memset(x,0,sizeof(x))
const ll inf=1000000000000000000; 

const long double ep=2.6180339887498948482045868343656;
inline int read()
{
	char C=getchar();
	int F=1,ANS=0;
	while (C<'0'||C>'9')
	{
		if (C=='-') F=-1;
		C=getchar();
	}
	while (C>='0'&&C<='9')
	{
		ANS=ANS*10+C-'0';
		C=getchar();
	}
	return F*ANS;
} 

ll n;
ll fib[200],cnt;
ll ans[200],sum;
int main()
{
	cin >> n;
	fib[1]=fib[2]=1;
	for (int i=3;i<=1000;i++)
	{
		fib[i]=fib[i-1]+fib[i-2];
		if (fib[i]>n) 
		{
			cnt=i-1;
			break;
		}
	}
	int tot=1;
	for (int i=cnt;i>=2;i--)
	{
		ll p=n/fib[i];
		ans[tot]=p;
		sum+=p;
		n-=p*fib[i];
		tot++;
	}
	cout << sum+cnt-1 << endl;
	ll x=0,y=0;
	for (int i=1;i<=cnt;i++) 
	{
		if (i!=1)
		{
			if ((i+cnt)%2==0) puts("3");
			else puts("4");	
			if (((i+cnt)%2==0)) x=x+y;
			else y=y+x;
		}
		for (int j=1;j<=ans[i];j++) 
		{
			if ((i+cnt)%2==0) puts("1");
			else puts("2");
			if (((i+cnt)%2==0)) x=x+1;
			else y=y+1;
		}
	}
	return 0;
}
//679891637638612258
//381966011250105144 618033988749894856
#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;
    ll x = 0;
    ll y = 0;
    vector<ll> ops;
    op(ops, x, y, 1);
    bool isx = true;
    while (true) {
        if (x + y > n || n < 10) {
            while (x < n) {
                op(ops, x, y, 1);
            }
            break;
        }
        ll curop = fibrest(x, y, n, isx);
        while (true) {
            ll nx = isx ? x+1 : x;
            ll ny = isx ? y : y+1;
            if (fibrest(nx, ny, n, isx) != curop) break;
            if(isx){
              op(ops, x, y, 1);
            }else{
              op(ops, x, y, 2);
            }
        }
        if (isx) {
            op(ops, x, y, 3);
        } else {
            op(ops, x, y, 4);
        }
        isx = !isx;
    }
    output(ops);
}
