#include <bits/stdc++.h>
void err() { std::cout << std::endl; }
template <typename T, typename... Args>
void err(T a, Args... args) {
  std::cout << a << ' ';
  err(args...);
}
using namespace std;
const int mod = 1e9 + 7;
const int maxn = 2e5 + 22;
int n, cnt;
int a[maxn];
int tot = 0;
bool isprime(long long a) {
  if (a <= 3) return a > 1;
  if (a % 6 != 1 && a % 6 != 5) return false;
  long long sqr = (long long)sqrt(a);
  for (long long i = 5; i <= sqr; i += 6) {
    if (a % i == 0 || a % (i + 2) == 0) return false;
  }
  return true;
}
long long p = 1;
int main() {
  cin >> n;
  for (long long i = 2; i <= n; i++) {
    if (isprime(i)) {
      for (int j = i; j <= n; j += i) {
        if (a[j] == 0) {
          a[j] = p;
        }
      }
      p++;
    }
  }
  for (long long i = 2; i <= n; i++) {
    cout << a[i] << " ";
  }
  return 0;
}
