#include <bits/stdc++.h>
using namespace std;
namespace Rahul {
bool isPrime(int n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (int i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
long int pow(int x, int y, long int z) {
  long int res = 1;
  while (y > 0) {
    if (y & 1) res = (res * x) % z;
    y = y / 2;
    x = (x * x) % z;
  }
  return res;
}
long int _gcd(long int a, long int b) {
  if (a == 0)
    return b;
  else
    return _gcd(b % a, a);
}
};  // namespace Rahul
using namespace Rahul;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  int prime[n + 1];
  int v = 1;
  unordered_map<int, int> cn;
  int c = 1;
  for (int i = 2; i <= n; i++) {
    if (isPrime(i))
      prime[i] = c++;
    else
      prime[i] = 0;
  }
  for (int p = 2; p * p <= n; p++) {
    if (prime[p] > 0) {
      for (int i = p * p; i <= n; i += p) prime[i] = prime[p];
    }
  }
  for (int i = 2; i <= n; i++) {
    cout << prime[i] << " ";
  }
}
