#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int count = 1;
  int arr[n + 1];
  for (int i = 0; i <= n; i++) arr[i] = -1;
  for (int i = 2; i <= n; i++) {
    if (arr[i] == -1) {
      for (int j = 1; i * j <= n; j++) {
        if (arr[i * j] == -1) arr[i * j] = count;
      }
      count++;
    }
  }
  for (int i = 2; i <= n; i++) {
    cout << arr[i] << " ";
  }
  return 0;
}
