#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int c[n + 1];
  for (int i = 0; i < n + 1; i++) c[i] = -1;
  int clr = 1;
  for (int i = 2; i <= sqrt(n); i++) {
    if (c[i] == -1) {
      c[i] = clr;
      for (int j = i * i; j <= n; j += i) c[j] = clr;
      clr++;
    }
  }
  for (int i = 2; i < n + 1; i++) {
    if (c[i] == -1) {
      c[i] = clr;
      clr++;
    }
  }
  for (int i = 2; i <= n; i++) cout << c[i] << " ";
  return 0;
}
