#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n + 1];
  memset(a, 0, sizeof(a));
  int sq = sqrt(n), k = 1;
  for (int i = 2; i <= n; i++) {
    if (!a[i]) {
      for (int j = i; j <= n; j += i) a[j] = k;
      k++;
    }
  }
  for (int i = 2; i <= n; i++) cout << a[i] << " ";
  cout << endl;
}
