#include <bits/stdc++.h>
using namespace std;
long long a[100005];
int is_prime(long long n) {
  if (n == 1) return 0;
  if (n == 2) return 1;
  for (long long i = 2; i * i <= n; i++) {
    if (n % i == 0) return 0;
  }
  return 1;
}
int main() {
  int n;
  cin >> n;
  long long pre_prime = 1;
  for (long long i = 2; i <= n; i++) {
    if (a[i] == 0) {
      for (long long j = i; j <= n; j = j + i) {
        if (a[j] == 0) {
          a[j] = pre_prime;
        }
      }
      pre_prime++;
    }
  }
  for (long long i = 2; i <= n; i++) {
    cout << a[i] << " ";
  }
}
