#include <bits/stdc++.h>
using namespace std;
int k = 0;
void SieveOfEratosthenes(int a[], int n) {
  bool prime[n + 1];
  memset(prime, true, sizeof(prime));
  for (int p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      a[p] = ++k;
      for (int i = p * p; i <= n; i += p) {
        prime[i] = false;
        a[i] = k;
      }
    }
  }
}
int main() {
  int n;
  cin >> n;
  int a[n + 1];
  memset(a, 0, sizeof(a));
  SieveOfEratosthenes(a, n);
  for (int i = 2; i <= n; i++) {
    if (a[i] == 0) {
      a[i] = ++k;
    }
  }
  for (int i = 2; i <= n; i++) {
    cout << a[i] << " ";
  }
  return 0;
}
