#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("fast-math")
#pragma GCC optimize("no-stack-protector")
using namespace std;
template <typename T>
void print(T a) {
  for (auto x : a) cout << x << ' ';
  cout << endl;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  vector<long long> res(n + 1, 0);
  long long cur = 0;
  for (long long i = 2; i <= n; i++) {
    if (res[i] != 0) continue;
    cur++;
    for (long long j = i; j <= n; j += i) res[j] = cur;
  }
  for (long long i = 2; i <= n; i++) cout << res[i] << ' ';
  return 0;
}
