#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  int N;
  cin >> N;
  vector<int> P(N + 1);
  int i, j;
  int C = 1;
  for (i = 2; i <= N; i++) {
    if (P[i] == 0) {
      for (j = (i * 2); j <= N; j += i) {
        if (P[j] == 0) {
          P[j] = C;
        }
      }
      cout << C++ << " ";
    } else {
      cout << P[i] << " ";
    }
  }
  cout << endl;
  return 0;
}
