#include <bits/stdc++.h>
using namespace std;
map<long long int, long long int> m1;
map<long long int, long long int> m2;
map<long long int, long long int>::iterator it;
long long int a[100003];
int main() {
  long long int n, i, j;
  cin >> n;
  for (i = 2; i * i <= n; i++) {
    if (a[i] == 1) continue;
    for (j = i * i; j <= n; j = j + i) a[j] = i;
  }
  long long int cnt = 1;
  a[2] = 1;
  for (i = 3; i <= n; i++) {
    if (a[i] == 0) {
      cnt++;
      a[i] = cnt;
    } else
      a[i] = a[a[i]];
  }
  for (i = 2; i <= n; ++i) cout << a[i] << " ";
  cout << endl;
  return 0;
}
