#include <bits/stdc++.h>
using namespace std;
long long c[200000], a[200000];
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  fill(c, c + 200000, 1);
  long long n;
  cin >> n;
  c[0] = c[1] = 0;
  for (long long i = 2; i <= 150000; i++) {
    if (c[i]) {
      if (i * 1LL * i <= 150000) {
        for (long long j = i * i; j <= 150000; j += i) {
          c[j] = 0;
        }
      }
    }
  }
  long long f = 0;
  for (long long i = 2; i <= n; i++) {
    if (a[i]) continue;
    f++;
    for (long long j = i; j <= n; j += i) {
      a[j] = f;
    }
  }
  for (long long i = 2; i <= n; i++) {
    cout << a[i] << ' ';
  }
  return 0;
}
