#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> a(n + 1);
  int cnt = 1;
  for (int i = 2; i <= n; i++) {
    if (a[i]) continue;
    a[i] = cnt;
    cnt++;
    for (int j = i; j <= n; j += i) a[j] = a[i];
  }
  for (int i = 2; i <= n; i++) cout << a[i] << " ";
  cout << '\n';
}
