#include <bits/stdc++.h>
using namespace std;
bool is_prime(int n) {
  if (n < 2) return false;
  if (n == 2) return true;
  if (n % 2 == 0) return false;
  for (int i = 3; i * i <= n; i++) {
    if (n % i == 0) {
      return false;
    }
  }
  return true;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int T = 1;
  for (int t = 1; t <= T; t++) {
    int n;
    cin >> n;
    int count = 1;
    int pre[n + 1];
    for (int64_t i = 2; i <= n; i++) {
      if (is_prime(i)) {
        pre[i] = count++;
        for (int64_t j = i * i; j <= n; j += i) {
          pre[j] = pre[i];
        }
      }
    }
    for (int i = 2; i <= n; i++) {
      cout << pre[i] << " ";
    }
  }
}
