#include <bits/stdc++.h>
using namespace std;
const long long int LLINF = 1e18;
const int INF = 1e9;
const int MOD = 1e9 + 7;
const double EPS = 1e-10;
const double PI = acos(-1);
const int SIZE = 200005;
int N;
int A[SIZE];
void solve() {
  int tt = 1;
  for (int i = 0; i < SIZE; i++) {
    A[i] = i;
  }
  for (int i = 2; i * i < SIZE; i++) {
    if (A[i] == i) {
      A[i] = tt;
      for (int j = i + i; j < SIZE; j += i) {
        A[j] = tt;
      }
      tt++;
    }
  }
  for (int i = 2; i < SIZE; i++) {
    if (A[i] == i) A[i] = tt++;
  }
}
int main() {
  solve();
  scanf("%d", &N);
  for (int i = 2; i <= N; i++) {
    printf("%d%c", A[i], i != N ? ' ' : '\n');
  }
  return 0;
}
