#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000 * 1000;
int a[MAXN];
int main(int argc, const char* argv[]) {
  int n;
  cin >> n;
  int cnt = 1;
  memset(a, -1, sizeof a);
  for (int i = 2; i <= n; i++) {
    if (a[i] == -1) {
      for (int j = i; j <= n; j += i) {
        a[j] = cnt;
      }
      cnt++;
    }
  }
  for (int i = 2; i <= n; i++) {
    printf("%i ", a[i]);
  }
  return 0;
}
