#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> vec(n + 1, 0);
  int count = 1;
  for (int i = 2; i * i <= n; i++) {
    if (vec[i] == 0) {
      vec[i] = count;
      for (int j = i * i; j <= n; j += i) {
        vec[j] = count;
      }
      count++;
    }
  }
  for (int i = 2; i < vec.size(); i++) {
    if (vec[i] == 0) {
      vec[i] = count;
      count++;
    }
    cout << vec[i] << " ";
  }
  cout << endl;
}
