#include <iostream>
#include <string>
#include <set>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <array>
typedef long long ll;
using namespace std;

const int logn = 17;
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n;
	cin >> n;
	vector<vector<int> > f(n+1, vector<int>(logn, 0));
	vector<int> ans(n + 1, 0);
	for (int i = 1; i <= n; i++)
	{
		ans[i] = -1;
		for (int j = 0; j < logn; j++)
		{
			if (!f[i][j])
			{
				ans[i] = j;
				break;
			}
		}
		for (int j = i; j <= n; j += i)
		{
			f[j][ans[i]]++;
		}
	}
	for (int i = 1; i <= n; i++) cout << ans[i] + 1 << " ";
	cout << "\n";
	return 0;
}
#include <bits/stdc++.h>
//#include <cmath>
#define int long long
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
#define pb push_back
#define mod 1000000007
//#define lld long double
#define mii map<int, int>
#define mci map<char, int>
#define msi map<string, int>
#define pii pair<int, int>
#define ff first
#define ss second
#define bs(yup,x) binary_search(yup.begin(),yup.end(),x) //it will return bollean value
#define lb(yup,x) lower_bound(yup.begin(),yup.end(),x)  //it will return the adress of the number which is equal to or just greater than x ,and if it is equal to yup.end() than their in no such number exist
#define ub(yup,x) upper_bound(yup.begin(),yup.end(),x)
#define all(x) (x).begin(), (x).end()
#define rep(i,x,y) for(int i=x; i<y; i++)
#define fill(a,b) memset(a, b, sizeof(a))
#define vi vector<int>
#define setbits(x) __builtin_popcountll(x)
using namespace std;
const long long N=100005, INF=2000000000000000000;
const long double EPS= 0.000000000001;
int power(int a, int b, int p)
    {
        if(a==0)
        return 0;
        int res=1;
        a%=p;
        while(b>0)
        {
            if(b&1)
            res=(res*a)%p;
            b>>=1;
            a=(a*a)%p;
        }
        return res;
    }
vi prime;
bool isprime[N];
void pre()
{
    for(int i=2;i<N;i++)
    {
        if(isprime[i])
        {
            for(int j=i*i;j<N;j+=i)
            {
                isprime[j]=false;
                prime.pb(i);
            }
        }
    }
    return;
}

int32_t main()
{
    
    IOS;
    //fill(isprime, true);
    //pre();
    int qter=1;
    //cin>>qter;
    for(int wert=1;wert<=qter;wert++)
    {
        //cout<<"Case #"<<wert<<": ";
        int n;
        cin>>n;
        int ans[n+1];
        ans[1]=1;
        rep(i,2,n+1) ans[i]=2;
        rep(i,2,n+1)
        {
            int val=ans[i];
            for(int j=i*2;j<=n;j+=i)
            {
                ans[j]=max(ans[j],ans[i]+1);
            }
        }
        rep(i,1,n+1) cout<<ans[i]<<" ";
        //cout<<ans<<"\n";
        
    }
}
 
