#include <bits/stdc++.h>
using namespace std;
long long prime[100005];
long long p[100005];
void sieve(long long n) {
  for (long long i = 2; i <= n; i += 2) {
    p[i] = 1;
    prime[i] = 1;
  }
  long long cnt = 2;
  for (long long i = 3; i <= n; i += 2) {
    if (p[i] == 0) {
      prime[i] = cnt;
      for (long long j = i * i; j <= n; j += i) {
        p[j] = 1;
        prime[j] = cnt;
      }
      cnt++;
    }
  }
  for (long long i = 2; i <= n; i++) {
    cout << prime[i] << " ";
  }
  cout << endl;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n;
  cin >> n;
  sieve(n);
}
