#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  int N = 1e6;
  vector<int> v(N + 5);
  int cnt = 0;
  for (int i = 2; i < N; i++) {
    if (!v[i]) {
      ++cnt;
      for (int j = i; j < N; j += i) v[j] = cnt;
    }
  }
  for (int i = 2; i <= n; i++) printf("%d ", v[i]);
}
