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

#define ll long long
#define pii pair<int, int>
#define all(c) ((c).begin()), ((c).end())
#define sz(x) ((int)(x).size())

#ifdef LOCAL
#include <print.h>
#else
#define trace(...)
#endif

int main(){
	ios_base::sync_with_stdio(false); 
	cin.tie(NULL); // Remove in interactive problems
	int n; cin >> n;
	vector<int> dp(n + 1, 1);
	for(int i = 1; i <= n; i++){
		for(int j = 2 * i; j <= n; j += i) dp[j] = max(dp[j], dp[i] + 1);
		cout << dp[i] << " ";
	}
	cout << endl;
}
#include <iostream>
#include <set>
#include <algorithm>
#include <vector>
#include <map>
#include <string>
using namespace std;
int main(void){
	long long n,i;
	cin >> n;
	vector<long long> a;
	a.resize(n+1);
	a.assign(n+1,-1);
	a[1] = 1;
	for(i=2;i<=n;i++) {
		if(a[i] == -1) {
			long long j;
			for(j=i*2;j<=n;j+=i) a[j] = -2;
			a[i] = 2;
		}
	}
	for(i=4;i<=n;i++) {
		if(a[i] == -2){
			if(i%2==0) a[i] = a[i/2]+1;
			else {
				long long j;
				for(j=3;j*j<=i;j+=2) {
					if(i%j==0){
						a[i] = a[i/j]+1;
						break;
					}
				}
			}
		}
	}
	for(i=1;i<n;i++) cout << a[i] << " ";
	cout << a[n] << '\n';
}
