//QwQcOrZ yyds!!!
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdalign>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

// C++
#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>

#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif
#define ll __int128
#define F(i,a,b) for (int i=(a);i<=(b);i++)
#define R(i,a,b) for (int i=(a);i<(b);i++)
#define D(i,a,b) for (int i=(a);i>=(b);i--)
#define go(i,x) for (int i=head[x];i;i=e[i].nx)
#define mp make_pair
#define pb push_back
#define pa pair < int,int >
#define fi first
#define se second
#define re register
#define be begin()
#define en end()
#define sqr(x) ((x)*(x))
#define ret return puts("-1"),0;
#define put putchar('\n')
#define inf 1000000005
#define mod 998244353
#define int ll
#define N 1000005
using namespace std;
inline char gc(){static char buf[100000],*p1=buf,*p2=buf;return p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++;}
#define gc getchar
inline ll read(){char c=gc();ll su=0,f=1;for (;c<'0'||c>'9';c=gc()) if (c=='-') f=-1;for (;c>='0'&&c<='9';c=gc()) su=su*10+c-'0';return su*f;}
inline void write(ll x){if (x<0){putchar('-');write(-x);return;}if (x>=10) write(x/10);putchar(x%10+'0');}
inline void writesp(ll x){write(x),putchar(' ');}
inline void writeln(ll x){write(x);putchar('\n');}
int n,f[N],t,a[N],ans;
signed main()
{
	n=read();
	if (n==1) 
	{
		puts("1\n1");
		return 0;
	}
	f[1]=1,f[2]=1;
	for (int i=3;i;i++) 
	{
		f[i]=f[i-1]+f[i-2];
	 	if (f[i]>n) 
	 	{
	 		t=i;
	 		break;
	 	}
	}
	t-=1;
	for (int i=t;i>=1;i--)
	{
		a[i]+=(n/f[i]);
		n%=f[i];
	}
	t=max(t,t^1);
	for (int i=1;i<=t;i++)
	{
		ans+=a[i]+1;
	}
	writeln(ans);
	for (int i=1;i<=t-i+1;i++)
	{
		swap(a[i],a[t-i+1]);
	}
	for (int i=1;i<=t;i++)
	{
		if (i%2) for (int j=1;j<=a[i];j++) writeln(1); 
		else for (int j=1;j<=a[i];j++) writeln(2);
		
		if (i%2) writeln(3);
		else writeln(4);
	}
		
}
/*
1 0
1 0
1 1
2 1
3 4
7 0
*/


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

#define nl "\n"
#define nf endl
#define ll long long
#define pb push_back
#define _ << ' ' <<

#define INF (ll)1e18
#define mod 998244353
#define maxn 110
#define phi ((1 + sqrt(5)) / 2)

ll i, i1, j, k, k1, t, n, m, res, flag[10], a, b;
vector<ll> rs;

void solve(ll a, ll b) {
    ll i;
    if (rs.size() == 131) return;

    if (a == 0) {
        for (i = 1; i <= b; i++) rs.pb(2);
        return;
    }
    if (b == 0) {
        for (i = 1; i <= a; i++) rs.pb(1);
        return;
    }

    if (a > b) {
        rs.pb(3); solve(a - b, b);
    } else {
        rs.pb(4); solve(a, b - a);
    }
}

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);

    #if !ONLINE_JUDGE && !EVAL
        ifstream cin("input.txt");
        ofstream cout("output.txt");
    #endif

    cin >> n;
    k = round(n / phi);

    for (i = max(-k, (ll)-100);; i++) {
        rs.clear();
        solve(n, k + i);
        if (rs.size() <= 130) break;
    }

    reverse(rs.begin(), rs.end());

    cout << rs.size() << nl;
    for (auto u : rs) cout << u << nl;

    return 0;
}
