#include <bits/stdc++.h>
using namespace std;
int main() {
  int n = 0, tw = 1, th = 2, fi = 3, k = 4, p = 0, j;
  int i = 0;
  cin >> n;
  vector<int> a(n + 1, 0);
  for (i = 2; i <= n; i++) {
    if (a[i] != 0)
      continue;
    else if (i % 2 == 0) {
      a[i] = tw;
      j = 2 * i;
      p = 3;
      while (j <= n) {
        a[j] = tw;
        j = i * p;
        p++;
      }
    } else if (i % 3 == 0) {
      a[i] = th;
      j = 2 * i;
      p = 3;
      while (j <= n) {
        a[j] = th;
        j = i * p;
        p++;
      }
    } else if (i % 5 == 0) {
      a[i] = fi;
      j = 2 * i;
      p = 3;
      while (j <= n) {
        a[j] = fi;
        j = i * p;
        p++;
      }
    } else {
      a[i] = k++;
      j = 2 * i;
      p = 3;
      while (j <= n) {
        a[j] = k - 1;
        j = i * p;
        p++;
      }
    }
  }
  for (i = 2; i <= n; i++) cout << a[i] << " ";
  return 0;
}
