#include <bits/stdc++.h>
using namespace std;
long long int Lpow(long long int a, long long int b) {
  long long int ans = 1;
  while (b > 0) {
    if (b % 2) ans = (ans * a);
    a = (a * a);
    b = b / 2;
  }
  return ans;
}
long long int gcd(long long int a, long long int b) {
  if (a % b == 0)
    return b;
  else
    return gcd(b, a % b);
}
signed main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  long long int n;
  cin >> n;
  vector<long long int> arr(n + 1, 0);
  long long int curr = 0;
  for (long long int i = 2; i <= n; i++) {
    if (arr[i] == 0) {
      curr++;
      arr[i] = curr;
      for (long long int j = i * i; j <= n; j += i) {
        if (arr[j] == 0) arr[j] = curr;
      }
    }
  }
  for (long long int i = 2; i <= n; i++) cout << arr[i] << " ";
  cout << '\n';
  return 0;
}
