#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=(n)-1;i>=0;i--)
#define perl(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define pb push_back
#define ins insert
#define pqueue(x) priority_queue<x,vector<x>,greater<x>>
#define all(x) (x).begin(),(x).end()
#define CST(x) cout<<fixed<<setprecision(x)
#define rev(x) reverse(x);
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
using pl=pair<ll,ll>;
using vpl=vector<pl>;
using vvpl=vector<vpl>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9+10;
const ll INF=4e18;
const ll dy[8]={-1,0,1,0,1,1,-1,-1};
const ll dx[8]={0,-1,0,1,1,-1,1,-1};
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

int main(){
    ll n;cin >> n;
    vector<set<ll>> dp(n+1);
    vl ans(n+1);
    repl(i,1,n+1){
        ll p=1;while(dp[i].count(p))p++;
        ans[i]=p;
        for(int j=i;j<=n;j+=i)dp[j].insert(ans[i]);
    }
    repl(i,1,n+1)cout << ans[i] <<" ";cout << endl;
}   
#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin >> N;
  if(N==1){cout<<1;}
  if(N==2){cout<<1<<' '<<2;}
  if(N==3){cout<<1<<' '<<2<<' '<<2;}
  if(N>3){
  vector<int> a(N);
  a[0]=1;
  a[1]=2;
  a[2]=2;
  cout<<a[0]<<' '<<a[1]<<' '<<a[2]<<' ';
  for (double i = 4; i <= N; i++) {
    a[i-1]=2;
    for(double j=2;j<=pow(i,0.5);j++){
      int l;
      l=i/j;
      double l2;
        l2=i/j;
      if(l==l2){
      a[i-1]=a[l-1]+1;
      break;}
      
    }
    cout<<a[i-1]<<' ';
  }
  }
  return 0;
}
