#include <vector>
#include <array>
#include <stack>
#include <queue>
#include <list>
#include <bitset>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <numeric>
#include <iostream>
#include <iomanip>
#include <string>
#include <chrono>
#include <random>
#include <cmath>
#include <cassert>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <functional>
#include <sstream>

using namespace std;


int main(int argc, char** argv) {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(12);


    int n;
    cin >> n;

    vector<int> res(n + 1, 1);
    for (int i = 1; i <= n; ++i) {
        for (int j = i + i; j <= n; j += i) {
            if (res[j] == res[i]) {
                ++res[j];
            }
        }
    }

    // for (int i = 1; i <= n; ++i) {
    //     for (int j = i + i; j <= n; j += i) {
    //         assert(res[j] != res[i]);
    //     }
    // }
    for (int i = 1; i <= n; ++i) {
        cout << res[i] << ' ';
    }
    cout << '\n';

    return 0;
}
#include<bits/stdc++.h>
#define rep(i,a,b) for(ll i=(a);i<=(b);i++)
#define per(i,a,b) for(ll i=(a);i>=(b);i--)
#define lc(x) (x<<1)
#define rc(x) (lc(x)|1)
#define lowbit(x) (x&-x)
#define Max(a,b) (a>b?a:b)
#define Min(a,b) (a<b?a:b)
#define next Cry_For_theMoon
#define il inline
#define pb(x) push_back(x)
#define mapit map<int,int>::iterator
#define vit vector<int>::iterator
#define mp(x,y) make_pair(x,y)
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef double db;
using namespace std;
const int MAXN=1e5+10;
int n,size[MAXN],ans;
int color[MAXN];
vector<int>v[MAXN];
int main(){
	cin>>n;
	rep(i,1,n){
		sort(v[i].begin(),v[i].end());
		color[i]=1;int pre=-1;
		for(vit it=v[i].begin();it!=v[i].end();it++){
			if(*it==pre)continue;
			pre=*it;
			if(color[i]==*it)color[i]++;
			else break;
		}
		rep(j,2,n){
			if(j*i>n)break;
			v[j*i].pb(color[i]);
		}
	} 
	rep(i,1,n)printf("%d ",color[i]);
	return 0;
}
