#include<ctime>
#include<cmath>
#include<cstdio>
#include<cctype>
#include<algorithm>
#define ll long long
using namespace std;
const double k=(sqrt(5)-1)/2;
const double t=k;
ll read(){
	char c;
	ll x=0,f=1;
	while(!isdigit(c=getchar()))
		f-=2*(c=='-');
	while(isdigit(c)){
		x=x*10+f*(c-48);
		c=getchar();
	}
	return x;
}
ll n,x,y,cnt,ans[1000];
void solve(){
	if(n==1){
		puts("1");
		puts("1");
		return;
	}
	ans[1]=3;
	for(ll i=max(0ll,(ll)(k*n-1000000));i<=min(n,(ll)(k*n+1000000));++i){
		x=i;
		cnt=1;
		y=n-x;
		while(x>=1&&y>=1){
			if(cnt>130)
				break;
			if(x>y){
				ans[++cnt]=3;
				x-=y;
			}
			else{
				ans[++cnt]=4;
				y-=x;
			}
		}
		while(x){
			if(cnt>130)
				break;
			--x;
			ans[++cnt]=1;
		}
		while(y){
			if(cnt>130)
				break;
			--y;
			ans[++cnt]=2;
		}
		if(cnt<=130)
			break;
	}
	printf("%lld\n",cnt);
	for(ll i=cnt;i;--i)
		printf("%lld\n",ans[i]);
}
int main(){
	#ifndef ONLINE_JUDGE
	freopen("C.in","r",stdin);
	freopen("C.out","w",stdout);
	#endif
	clock_t t1=clock();
	//--------
	n=read();
	solve();
	//--------
	fprintf(stderr,"%0.3lfs",1.0*(clock()-t1)/CLOCKS_PER_SEC);
	return 0;
}
#include <cmath>
#include <cstdio>
#include <stack>
using namespace std;

int main() {
	long long N;
	scanf("%lld", &N);
	stack<int> ans;
	long long x, y;
	x = N;
	__float128 phi = (1 + sqrtf128((__float128)5)) / 2;
	y = (long long)(x / phi) + 1;
	for (; x != 0 || y != 0;) {
		if (y == 0) {
			ans.push(1);
			x--;
		} else if (x == 0) {
			ans.push(2);
			x--;
		} else if (x > y) {
			if ((y - 1) * phi > x) {
				ans.push(2);
				y--;
			} else {
				ans.push(3);
				x -= y;
			}
		} else {
			if ((x - 1) * phi > y) {
				ans.push(1);
				x--;
			} else {
				ans.push(4);
				y -= x;
			}
		}
	}
	printf("%lu\n", ans.size());
	x = 0;
	y = 0;
	for (; !ans.empty();) {
		printf("%d\n", ans.top());
		if (ans.top() == 1) x++;
		if (ans.top() == 2) y++;
		if (ans.top() == 3) x += y;
		if (ans.top() == 4) y += x;
		ans.pop();
	}
	fprintf(stderr, "%lld\n", x);
	return 0;
}
