#include <bits/stdc++.h>

using namespace std;

int main()
{
   int n;
   cin>>n;
   vector<int> answers(n+1,1);
   for(int i=2;i<=n;i++){
       set<int> divisors;
       for(int j=1;j<=sqrt(i);j++){
           if(i%j==0){
           divisors.insert(answers[j]);
            divisors.insert(answers[i/j]);   
           }
       }
       int index=1;
       while(true){
           if(divisors.count(index)==0){
               break;
           }
           index++;
       }
       answers[i]=index;
    }
   for(int i=1;i<=n;i++){
       cout<<answers[i]<<" ";
   }
   return 0;
}
#include <bits/stdc++.h>
#define ALL(v) v.begin(), v.end()
#define MAX 510000
#define rrep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep(i, n) for(ll i = 1; i <= (ll)(n); i++)
#define dcout cout<<fixed<<setprecision(15);
#define mp make_pair
#define pb push_back

using namespace std;
typedef long long int  ll;
typedef pair<ll, ll> P;

constexpr int MOD = 998244353;
constexpr ll inf = 1LL << 60;

template< typename S, typename T >
inline void chmax(S &a, const T &b) { if(a < b) a = b; }
 
template< typename S, typename T >
inline void chmin(S &a, const T &b) { if(a > b) a = b; }
 

//lcm//
ll gcd(ll x, ll y) {
	if (x == 0) return y;
	return gcd(y%x, x);
}
ll lcm(ll x, ll y) { return x * y / gcd(x, y); }

//a^n mod p//
ll modpow(ll a, ll n, ll p) {
	if(n==0) return (ll)1;
  if (n == 1) return a % p;
  if (n % 2 == 1) return (a * modpow(a, n - 1, p)) % p;
  ll t = modpow(a, n / 2, p);
  return (t * t) % p;
}

//inversemod//
ll modinv(ll a, ll m) {
	if(m==0)return (ll)1;
	ll b = m, u = 1, v = 0;
	while (b) {
		ll t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}

//Cmonp//
ll fac[MAX], finv[MAX], inv[MAX];
// 
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX; i++) {
		fac[i] = fac[i - 1] * i % MOD;
		inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
		finv[i] = finv[i - 1] * inv[i] % MOD;
	}
}

// 
ll COM(ll n, ll k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

//LARGE n
ll com(ll n,ll m){
    if(n<m || n<=0 ||m<0){
		return 0;
	}
	if( m==0 || n==m){
		return 1;
	}
	ll k=1;
	for(ll i=1;i<=m;i++){
       k*=(n-i+1); 
	   k%=MOD;
	   k*=modinv(i,MOD);
	   k%=MOD;
	}
	return k;
}

//radP
ll rad(ll u, ll p){
ll cnt=0;
	while(u%p==0){
		u/=p;
		cnt++;
	}
	return cnt;
}


////////////////////////////////////////////////////////////////////

ll d(ll n){
for(ll i=1;i<=15;i++){
	if(n<=9){return i;
	break;}
	else n/=10;
}

}



ll ks(ll n){
	ll val=1;
		
for(int k=1;k<=100;k++){
	ll fin=0;
	if(n==1){return val;}
	for(int i=2;i<=n;i++){
		if(n%i==0){n/=i;
		val++;
	
		break;}
		if((i+1)*(i+1)>n){return val+1;}
	}
	if(fin==1 || n==1){return val;}
}
}

int main() {
 ios::sync_with_stdio(false);

ll n;
cin>>n;


if(n==1){
  cout<<1<<endl;
  return 0;}
cout<<1<<" ";
for(ll i=2;i<=n-1;i++){
	cout<<ks(i)<<" ";
}
cout<<ks(n)<<endl;
return 0;

}