#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;
int main() {
  int n;
  cin >> n;
  vector<int> num(n + 1);
  int now = 1;
  for (int i = 2; i <= n; ++i)
    if (num[i] == 0) {
      for (int j = i; j <= n; j += i)
        if (num[j] == 0) num[j] = now;
      ++now;
    }
  for (int i = 2; i <= n; ++i) cout << num[i] << " ";
  return 0;
}
