#include <bits/stdc++.h>
using namespace std;
long long x[1000000] = {0};
int main() {
  int n;
  cin >> n;
  int m = 1;
  for (int i = 2; i <= n; i++) {
    if (x[i] == 0) {
      for (int j = 1; j * i <= n; j++) {
        x[i * j] = m;
      }
      m++;
    }
  }
  for (int i = 2; i <= n; i++) {
    cout << x[i] << ' ';
  }
  cout << endl;
  return 0;
}
