#include<bits/stdc++.h>
using namespace std;
const double phi=(1+sqrt(5))/2;

int main(){
  long long N;
  cin>>N;
  long long T=(long long)(N/(1+phi)-500000);
  for(int ttt=0;ttt<1000000;ttt++){
    if(T+ttt<0)continue;
    vector<array<long long,2>>A(1);
    A[0]={N,T+ttt};
    for(int i=0;i<130;i++){
      if(A[i][0]<A[i][1]){
        A.push_back({A[i][0],A[i][1]-A[i][0]});
      }else if(A[i][0]>A[i][1]){
        A.push_back({A[i][0]-A[i][1],A[i][1]});
      }else if(A[i][0]==0||A[i][1]==0){
        break;
      }else if(A[i][0]<=9){
        A.push_back({A[i][0],0});
        break;
      }else{
        double x=A[i][0]/(1+phi)*phi;
        while(A[i][0]>x){
          if(i>130)break;
          A.push_back({A[i][0]-1,A[i][1]});
          i++;
        }
        i--;
      }
    }
    if(A.size()+max(A.back()[0],A.back()[1])>130)continue;
    reverse(A.begin(),A.end());
    cout<<A.size()-1+max(A[0][0],A[0][1])<<'\n';
    if(A[0][0]>0){
      for(int i=0;i<A[0][0];i++)cout<<"1\n";
    }else{
      for(int i=0;i<A[0][1];i++)cout<<"2\n";
    }
    for(int i=1;i<A.size();i++){
      if(A[i][0]==A[i-1][0]+A[i-1][1]&&A[i][1]==A[i-1][1]){
        cout<<"3\n";
      }else if(A[i][1]==A[i-1][0]+A[i-1][1]&&A[i][0]==A[i-1][0]){
        cout<<"4\n";
      }else if(A[i][0]==A[i-1][0]+1){
        cout<<"1\n";
      }else{
        cout<<"2\n";
      }
    }
    return 0;
  }
}

#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <functional>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <bitset>
#include <math.h>
#include <random>
#include <chrono>
#include <assert.h>
using namespace std ;
using ll = long long ;
using ld = long double ;
template<class T> using V = vector<T> ;
template<class T> using VV = V<V<T>> ;
using pll = pair<ll,ll> ;
#define all(v) v.begin(),v.end()
ll mod = 1000000007 ;
long double pie = acos(-1) ;
ll INF = 1e18 ;
 
void yorn(bool a){if(a) cout << "Yes" << endl ; else cout << "No" << endl ;}
//void YorN(bool a){if(a) cout << "YES" << endl ; else cout << "NO" << endl ;}
ll gcd(long long a,long long b){if(b==0) return a ; return gcd(b,a%b) ;}
ll lcm(long long a,long long b){return a/gcd(a,b)*b ;}
ll extGCD(ll a,ll b,ll &x,ll &y){
    if(b==0){
        x = 1 ;
        y = 0 ;
        return a ;
    }
    ll d = extGCD(b,a%b,y,x) ;
    y -= a/b*x ;
    return d ;
}
void fix_cout(){cout << fixed << setprecision(20) ;}
template<class T> void chmax(T &a,T b){if(a<b) a = b ;}
template<class T> void chmin(T &a,T b){if(a>b) a = b ;}

int main(){
    ll n ; cin >> n ;
    V<pair<ll,ll>> f(88) ;
    f[0] = {0,0} ;
    f[1] = {1,0} ;
    for(int i=2;i<88;i++){
        f[i].first = f[i-1].first+f[i-1].second ;
        f[i].second = f[i-1].first ;
    } 
    V<bool> use(88,false) ;
    ll m = n ;
    for(int i=87;i>0;i--){
        if(m>=f[i].first){
            use[i] = true ;
            m -= f[i].first ;
        }
    }
    int t = 0 ;
    V<int> ans ;
    pair<ll,ll> cur(0,0) ;
    while(cur.first!=n){
        if(use[87-t]){
            if(t&1){
                ans.push_back(2) ;
                cur.second++ ;
            }else{
                ans.push_back(1) ;
                cur.first++ ;
            }
        }
        if(t&1){
            ans.push_back(4) ;
            cur.second += cur.first ;
        }else{
            ans.push_back(3) ;
            cur.first += cur.second ;
        }
        t++ ;
    }
    reverse(all(ans)) ;
    for(int i=(int)ans.size()-1;i>=0;i--){
        if(ans[i]<=2) break ;
        ans.pop_back() ;
    }
    reverse(all(ans)) ;
    cout << ans.size() << endl ;
    for(auto i:ans) cout << i << endl ;
}