#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  bool prime[n + 1];
  int a[n + 1];
  int c = 0;
  memset(prime, 1, sizeof(prime));
  memset(a, -1, sizeof(a));
  for (int p = 2; p * p <= (n); p++) {
    if (prime[p]) {
      c++;
      a[p] = c;
      for (int i = p * p; i <= n; i = i + p) {
        prime[i] = false;
        if (a[i] == -1) a[i] = c;
      }
    }
  }
  for (int i = 2; i <= n; i++) {
    if (prime[i] && a[i] == -1) {
      c++;
      a[i] = c;
    }
  }
  for (int i = 2; i <= n; i++) cout << a[i] << " ";
}
