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

#define REP(i,n) for(ll i=0;i<(ll)n;i++)
#define dump(x)  cerr << "Line " << __LINE__ << ": " <<  #x << " = " << (x) << "\n";
#define spa << " " <<
#define fi first
#define se second
#define ALL(a)  (a).begin(),(a).end()
#define ALLR(a)  (a).rbegin(),(a).rend()

using ld = long double;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pdd = pair<ld, ld>;

template<typename T> using V = vector<T>;
template<typename T> using P = pair<T, T>;
template<typename T> vector<T> make_vec(size_t n, T a) { return vector<T>(n, a); }
template<typename... Ts> auto make_vec(size_t n, Ts... ts) { return vector<decltype(make_vec(ts...))>(n, make_vec(ts...)); }
template<class S, class T> ostream& operator << (ostream& os, const pair<S, T> v){os << "(" << v.first << ", " << v.second << ")"; return os;}
template<typename T> ostream& operator<<(ostream &os, const vector<T> &v) { for (auto &e : v) os << e << ' '; return os; }
template<class T> ostream& operator<<(ostream& os, const vector<vector<T>> &v){ for(auto &e : v){os << e << "\n";} return os;}
struct fast_ios { fast_ios(){ cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;

template <class T> void UNIQUE(vector<T> &x) {sort(ALL(x));x.erase(unique(ALL(x)), x.end());}
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
void fail() { cout << -1 << '\n'; exit(0); }
inline int popcount(const int x) { return __builtin_popcount(x); }
inline int popcount(const ll x) { return __builtin_popcountll(x); }
template<typename T> void debug(vector<vector<T>>&v,ll h,ll w){for(ll i=0;i<h;i++)
{cerr<<v[i][0];for(ll j=1;j<w;j++)cerr spa v[i][j];cerr<<"\n";}};
template<typename T> void debug(vector<T>&v,ll n){if(n!=0)cerr<<v[0];
for(ll i=1;i<n;i++)cerr spa v[i];
cerr<<"\n";};

const ll INF = (1ll<<62);
// const ld EPS   = 1e-10;
// const ld PI    = acos(-1.0);
const ll mod = (int)1e9 + 7;
//const ll mod = 998244353;

int main(){

    ll N;
    cin >> N;
    
    ll MA = 90;
    V<ll> fib(MA);
    fib[0] = 0;
    fib[1] = 1;
    REP(i, MA-2) fib[i+2] = fib[i+1] + fib[i];

    ll x = N;
    V<ll> ids;
    REP(i, MA-1){
        if(x >= fib[MA-1-i]){
            ids.push_back(MA-1-i);
            x -= fib[MA-1-i];
        }
    }

    ll sz = ids.size();

    V<ll> X = ids, Y = ids;
    REP(i, sz) Y[i]--;

    V<ll> res;
    for(ll t=0;;t++){
        REP(i, sz){
            if(X[i] == 1){
                X[i]--;

                if(t%2==0) res.push_back(1);
                else res.push_back(2);
            }
        }

        bool ok = true;
        REP(i, sz) if(X[i] != 0) ok = false; 
        REP(i, sz) if(Y[i] != 0) ok = false; 
        if(ok) break;

        REP(i, sz){
            if(X[i] >= 2){
                X[i] -= 2;
            }
        }

        if(t%2 == 0) res.push_back(3);
        else res.push_back(4);

        swap(X, Y);
    }

    reverse(ALL(res));
    cout << res.size() << endl;
    for(auto x: res) cout << x << endl;

    return 0;
}
#include <cstdio>
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <list>
#include <climits>
#include <bitset>
#include <fstream>
#include <algorithm>
#include <functional>
#include <stack>
#include <string>
#include <cmath>
#include <numeric>
#include <tuple>
#include <cassert>
#include <random>
#include <chrono>
#include <ext/rope>
#include <unordered_map>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/priority_queue.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#define rep(i,a,n) for (int i=a;i<=n;i++)
#define per(i,a,n) for (int i=a;i>=n;i--)
#define sz(x) (x).size()
#define lbt(x) ((x)&(-x))
#define all(x) (x).begin(),(x).end()
#define mem(a,b) memset(a,b,sizeof(a))
#define fun function
#define fi first
#define se second
#define re register
#define ls i << 1
#define rs i << 1 | 1
#define pb push_back
#define mkp make_pair
#define pii pair<int,int>
#define pdi pair<double,int>
#define pdd pair<double,double>
#define mod 1000000007

#define int long long

using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;
typedef long long ll;
typedef unsigned long long ull;
typedef rope<char> RPstring;
typedef __gnu_pbds::tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> RBtree;
/*rk = t.order_of_key(v)+1, get_k = *t.find_by_order(k)*/ /*idx begin of 0*/
typedef __gnu_pbds::priority_queue<pii,greater<pii>,pairing_heap_tag> PQ_pii_s;//small
typedef __gnu_pbds::priority_queue<pii,less<pii>,pairing_heap_tag> PQ_pii_b;//big
// gp_hash_table<T,T> x
const double eps = 1e-8;
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3f;
const double pi = acos(-1.0);
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
int tt;

inline int rd(){
  int x = 0, f = 1; char ch = getchar();
  while (ch < '0' || ch>'9') { if (ch == '-')f = -1; ch = getchar(); }
  while (ch >= '0' && ch <= '9') { x = x * 10 + ch - '0'; ch = getchar(); }
  return x * f;
}

void out(int a) {if(a<0)putchar('-'),a=-a;if(a>=10)out(a/10);putchar(a%10+'0');}
#define pnt(x) out(x),puts("")
#define put(x) out(x), putchar(' ')
#define putschar(x) putchar(x), puts("")

//int t[maxn];
//void upd(int p, int x) {for(;p<=n;p+=lbt(p))t[p]+=x;}
//int ask(int p) {int ret = 0;for(;p;p-=lbt(p))ret+=t[p];return ret;}

int bit_cnt(int x) {int res=0;while(x)res+=x&1,x>>=1;return res;}
int INT(string x, int sys) {int base=sys,res=0;for(auto i: x)res*=sys,res+=i-'0';return res;}//sys->10
string TNI(int x, int sys) {string res="";while(x)res+=x%sys+'0',x/=sys;reverse(all(res));return res;}//10->sys

int gcd(int a, int b) {return b?gcd(b,a%b):a;} int lcm(int a, int b) {return a*b/gcd(a,b);}
ll mul(ll a, ll b, int m) {ll ret = 0ll;while(b){if(b&1)ret+=a,ret%=m;a+=a,a%=m,b>>=1;}return ret;}
ll mul(ll a, ll b) {ll ret = 0ll;while(b){if(b&1)ret+=a;a+=a,b>>=1;}return ret;}
ll ksm(ll a, ll b, int m) {ll ret = 1ll;while(b){if (b&1) ret*=a,ret%=m;a*=a,a%=m,b>>=1;}return ret;}
ll ksm(ll a, ll b) {ll ret = 1ll;while(b){if(b&1)ret*=a;a*=a,b>>=1;}return ret;}
ll inv(ll x, int m) {return ksm(x,m-2,m);}

void run() {
  string s;
  cin >> s;
  rotate(s.begin(), s.begin()+1, s.end());
  cout << s;
}

signed main(){
//  for (tt = rd(); tt--; )
  run();
  return 0;
}