#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e6 + 5;
int n, tot;
int a[maxn];
int main() {
  int fuc;
  scanf("%d", &n);
  for (int i = 2; i <= n; i++) {
    fuc = 0;
    if (a[i]) continue;
    ++tot;
    for (int j = i; j <= n; j += i) {
      fuc++;
      if (a[j]) continue;
      a[j] = tot;
    }
  }
  int kooo[10001];
  fuc = fuc + 1;
  cout << a[2];
  for (int i = 3; i <= n; ++i) printf(" %d", a[i]);
  puts("");
  return 0;
}
