#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long int n, i, j, k = 1;
  cin >> n;
  long long int a[n + 1];
  bool pri[n + 1];
  memset(pri, true, sizeof(pri));
  for (i = 2; i <= n; i++) {
    if (pri[i] == true) {
      a[i] = k;
      for (j = i * i; j <= n; j += i) {
        pri[j] = false;
        a[j] = k;
      }
      k++;
    }
  }
  for (i = 2; i <= n; i++) cout << a[i] << " ";
}
