#include <algorithm>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

#define ALL(a) (a).begin(), (a).end()

#define min_e(v) *min_element(ALL(v))
#define max_e(v) *max_element(ALL(v))

#define acm accumulate
#define SUM(v) accumulate(ALL(v), 0l)
#define SORT(v) sort(ALL(v))
#define P 1000000007
long powP (long a, long b) {
  if (b == 1) return a;
  else if (b == 0) return 1;
  else if (b < 0) return powP(a, P - 1 + b);
  else {
    long b2 = powP(a, b/2);
    b2*=b2;
    b2%=P;
    return (b2 * powP(a, b%2)) % P;
  }
}

template <typename T>
using vec = vector<T>;

template <typename T>
using vvec = vector<vector<T>>;

#define INF INT_MAX
#define pii pair<int, int>

int main() {
  long n;
  cin>>n;
  vec<long> fib(2,1);
  do {
    fib.push_back(*(fib.end()-1)+*(fib.end()-2));
  } while (fib.back()<pow(10,18));
  int m = fib.size();
  vec<int> fibs(m);
  int o = (upper_bound(ALL(fib), n)-fib.begin()-1);
  while (n!=0) {
    int i = (upper_bound(ALL(fib), n)-fib.begin()-1);
    fibs[i]++;
    n-=fib[i];
  }
  
  int flag = o%2;
  vec<int> exe(0);
  for (int i = o; i >= 0; i--) {
    exe.push_back(3+flag);
    
    for (int j = 0; j < fibs[i]; j++) {
      exe.push_back(1+flag);
    }
    
    flag=1-flag;
  }
  
  cout<<exe.size()<<endl;
  for (int i = 0; i < exe.size(); i++) {
    cout<<exe[i]<<endl;
  }
}

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define ll long long
#define ld long double
#define all(a) (a).begin(),(a).end()
#define mk make_pair
#define pp pair<ll,ll>
ll MOD=1000000007;
ll mod=998244353;
int inf=2000001000;
ll INF=1e18+5;


int main() {
    ll n;
    cin >> n;
    vector<ll> a;
    a.push_back(1);
    a.push_back(1);
    int u=0;
    while(true){
        if (a[u]+a[u+1]>n) break;
        a.push_back(a[u]+a[u+1]);
        u++;
    }
    u=a.size();
    n-=a[u-1];
    vector<int> c(u);
    rep(i,a.size()){
        while(true){
            if (n<a[u-i-1]) break;
            c[u-i-1]++;
            n-=a[u-i-1];
        }
    }
    if (n==1){
        cout << 1 << endl;
        cout << 1 << endl;
        return 0;
    }
    vector<int> ans;
    int st;
    // cout << u << endl;
    // rep(i,u) cout << a[i] << endl;
    // cout << endl;
    if (u%2==1){
        st=0;
        ans.push_back(1);
    }
    else {
        st=1;
        ans.push_back(2);
    }
    rep(i,a.size()-1){
        rep(j,c[u-1-i]){
            if (st==0) ans.push_back(1);
            else ans.push_back(2);
        }
        if (st==0) ans.push_back(4);
        else ans.push_back(3);
        st=1-st;
    }
    cout << ans.size() << endl;
    rep(i,ans.size()){
        cout << ans[i] << endl;
    }
}
