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