#include <bits/stdc++.h>
using namespace std;
const int max_n = 1e5 + 5;
int n, a[max_n];
bool isprime(int x) {
  for (int i = 2; i * i <= x; i++)
    if (x % i == 0) return 0;
  return 1;
}
int main() {
  cin >> n;
  int now = 1;
  for (int i = 2; i <= n; i++) {
    if (isprime(i)) {
      for (int j = i; j <= n; j += i) a[j] = now;
      now++;
    }
    if (a[i] == 0) a[i] = now;
  }
  for (int i = 2; i <= n; i++) cout << a[i] << " ";
  return 0;
}
