#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e6;
int n;
bool isPrime[MAXN + 10];
int small[MAXN + 10];
vector<int> primeList;
int cnt[MAXN + 10];
void sieve() {
  int i, j;
  for (i = 2; i <= MAXN; i++) isPrime[i] = true;
  for (i = 2; i * i <= MAXN; i++) {
    if (!isPrime[i]) continue;
    small[i] = i;
    for (j = i * i; j <= MAXN; j += i) isPrime[j] = false, small[j] = i;
  }
  int k = 1;
  for (i = 2; i <= MAXN; i++)
    if (isPrime[i]) primeList.push_back(i), cnt[i] = k++;
  for (i = 2; i <= MAXN; i++)
    if (small[i] == 0) small[i] = i;
}
int main() {
  int i, j;
  sieve();
  scanf("%d", &n);
  for (i = 2; i <= n; i++) printf("%d ", cnt[small[i]]);
}
