#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 322;
const long long LINF = 2e18 + 474;
const long long MAXN = 1e5 + 228;
const long long MOD = 1e9 + 7;
const double eps = 1e-12;
long long prime[MAXN], ans[MAXN], q = 0;
void solve() {
  long long n;
  cin >> n;
  for (long long i = 2; i < MAXN; i++) {
    prime[i] = 1;
  }
  for (long long i = 2; i <= n; i++) {
    if (prime[i]) {
      q++;
      for (long long j = i; j <= n; j += i) {
        prime[j] = 0;
        ans[j] = q;
      }
    }
  }
  for (int i = 2; i <= n; i++) {
    cout << ans[i] << " ";
  }
}
int main() {
  if (!1) {
    freopen(
        "474"
        ".in",
        "r", stdin);
    freopen(
        "474"
        ".out",
        "w", stdout);
  }
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  setlocale(LC_ALL, "Russian");
  int T = 1;
  while (T--) {
    solve();
  }
  return 0;
}
