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

long long n;
vector<long long> v(2, 1);

vector<int> solve();

int main() {
  for (int i = 2;; ++i) {
    if (v[i - 2] + v[i - 1] >= 1e18) break;
    v.push_back(v[i - 2] + v[i - 1]);
  }
  cin >> n;
  auto res = solve();
  cout << res.size() << endl;
  for (auto p : res) cout << p << endl;
  return 0;
}

vector<int> solve() {
  vector<int> res;
  long long rem = n;
  for (int i = 86; i; --i) {
    long long now = rem / v[i];
    while (now--) res.push_back(1 + (i & 1));
    rem %= v[i];
    res.push_back(4 - (i & 1));
  }
  long long x = 0, y = 0;
  for (auto p : res) {
    if (p == 1)
      ++x;
    else if (p == 2)
      ++y;
    else if (p == 3)
      x += y;
    else
      y += x;
  }
  assert(x == n);
  assert(res.size() <= 130);
  return res;
}
#include <bits/stdc++.h>
using namespace std;

long long X;
vector<long long> fibo = {0,1};
vector<int> ans = {1};
bitset<100> bs;

int main() {
    scanf("%lld", &X);
    while (fibo[fibo.size()-2] + fibo[fibo.size()-1] <= X) fibo.push_back(fibo[fibo.size()-2] + fibo[fibo.size()-1]);
    int K = fibo.size();
    X -= fibo.back();
    while (X) {
        while (fibo.back() > X) fibo.pop_back();
        bs[fibo.size()] = true;
        X -= fibo.back();
    }
    for (int i = 1; i < K-1; ++i) {
        ans.push_back(3+i%2);
        if (bs[K-i]) ans.push_back(1+i%2);
    }
    printf("%d\n", ans.size());
    if (K % 2 == 0) {
        for (int x: ans) printf("%d\n", x);
    }
    else {
        for (int x: ans) {
            if (x <= 2) printf("%d\n", 3-x);
            else printf("%d\n", 7-x);
        }
    }

    return 0;
}
