#include <bits/stdc++.h>
using namespace std;
void mad(long long &a, long long b) {
  a = (a + b) % 1000000007;
  if (a < 0) a += 1000000007;
}
long long gcd(long long a, long long b) {
  if (a > b) swap(a, b);
  if (!a) return b;
  return gcd(b % a, a);
}
int mk[100005];
void solve() {
  int n;
  cin >> n;
  int c = 1;
  for (int i = 2; i <= n; i++) {
    if (mk[i]) continue;
    for (int j = i; j <= n; j += i)
      if (!mk[j]) mk[j] = c;
    c++;
  }
  for (int i = 2; i <= n; i++) cout << mk[i] << " ";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  t = 1;
  while (t--) {
    solve();
  }
}
