#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 5;
long long a[N];
long long count1 = 1;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  long long n;
  cin >> n;
  for (long long i = 2; i <= n; i++) {
    if (a[i] == 0) {
      for (long long j = i; j <= n; j += i) {
        if (a[j] == 0) {
          a[j] = count1;
        }
      }
      count1++;
    }
  }
  for (long long i = 2; i <= n; i++) {
    cout << a[i] << " ";
  }
  cout << endl;
}
