#include <bits/stdc++.h>
using namespace std;
long long power(long long a, long long b) {
  long long res = 1ll;
  while (b > 0) {
    if (b % 2 != 0) res = (res * a) % 1000000007;
    a = (a * a) % 1000000007;
    b /= 2;
  }
  return res;
}
long long ncr(long long n, long long k) {
  if (k > n - k) k = n - k;
  long long pro = 1;
  for (long long i = 0; i < k; i++) {
    pro = (pro * (n - i)) % 1000000007;
    pro /= (i + 1);
  }
  return (pro % 1000000007);
}
vector<long long> prime;
void seive() {
  vector<bool> isprime(2000001, true);
  for (int i = 2; i * i <= 2000000; i++) {
    if (isprime[i]) {
      for (int j = i * i; j <= 2000000; j += i) {
        isprime[j] = false;
      }
    }
  }
  for (int i = 2; i <= 1000000; i++) {
    if (isprime[i]) prime.push_back(i);
  }
}
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, a;
  cin >> n;
  seive();
  vector<long long> arr(n);
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  vector<long long> ans(n + 1);
  long long cnt = 1;
  for (int i = 0; i < prime.size() && prime[i] <= n; i++) {
    for (int j = prime[i]; j <= n; j += prime[i]) ans[j - 1] = cnt;
    cnt++;
  }
  for (int i = 1; i < n; i++) cout << ans[i] << " ";
  return 0;
}
