#include <iostream>
#include <vector>
#include<iomanip>
#include<functional>
#include<algorithm>
#include<deque>
#include<math.h>
#include<set>
#include<cstdio>
#include<string>
#include<queue>
#include<complex>
#include<numeric>
#include<stack>
#include<unordered_map>
#include<map>
using namespace std;
#define rep(i,n) for(ll i = 0;i<n;i++)
#define req(i,n) for(ll i = 1;i<=n;i++)
#define rrep(i,n) for(int i = n-1;i>=0;i--)
#define ALL(a) a.begin(),a.end()
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
typedef long long ll;
typedef long double ld;
const int MOD = 1e9 + 7;
int main() {
    int n; cin >> n; vector<set<int>> v(n + 1);
    vector<int> a(n+1,0); int cnt;
    req(i, n) {
        cnt = 1;
        if (v[i].size() == 0) {
            a[i] = cnt;
        }
        else {
            for (int j : v[i]) {
                if (j == cnt) cnt++;
                else {
                    a[i] = cnt; break;
                }
            }if (a[i] == 0) a[i] = cnt;
        }for (int j = i; j <= n; j += i) {
            v[j].insert(cnt);
        }
    }req(i,n) cout << a[i] << " ";
    cout << endl;
}
#include<iostream>
#include<string>
#include<iomanip>
#include<cmath>
#include<vector>
#include<algorithm>
#include<utility>

using namespace std;

#define int long long
#define endl "\n"

constexpr long long INF = (long long)1e18;
constexpr long long MOD = 1'000'000'007; 

// struct fast_io {
	// fast_io(){
		// std::cin.tie(nullptr);
		// std::ios::sync_with_stdio(false);
	// };
// } fio;

signed main(){
	cout<<fixed<<setprecision(10);
	
	int N;
	int x = 0, y = 0;
	
	cin>>N;
	
	
	int X = N;
	int Y = N * 1.618033988749894848204586834365;
	Y = max(1ll, Y-10000);
	
	int mini = INF;
	for(int j = 0; ; j++){
		x = X;
		y = Y+j;
		
		int con = 0;
		
		for(;;){
			// cout<<x<<" "<<y<<endl;
			
			con++;
			// string s;
			
			// cin>>s;
			
			if(x > y) x -= y;
			else y -= x;
			
			if(!x || !y) {
				con += x + y;
				break;
			}
			if(con >= 140) break;
		}
		
		if(con <= 130) {
			x = X;
			y = Y+j;
			vector<int> ans;
			
			for(;;){
				
				con++;
				if(x > y) {
					x -= y;
					ans.push_back(3);
				} else {
					ans.push_back(4);
					y -= x;
				}
				if(!x || !y) {
					// con += x + y;
					if(x == 0) {
						for(int i = 0; i < y; i++){
							ans.push_back(2);
						}
					} else {
						for(int i = 0; i < x; i++){
							ans.push_back(1);
						}
					}
					break;
				}
			}
			
			cout<<ans.size()<<endl;
			
			for(int i = 0; i < ans.size(); i++){
				cout<<ans[ans.size()-i-1]<<endl;
			}
			return 0;
		}
	}
	
	// cout<<"mini = "<<mini<<endl;
	
	return 0;
}