#include <bits/stdc++.h>
#define rep(i, x, y) for (int i = x; i <= y; i++)
using namespace std;

const int N = 1e5 + 10;
int n, fa[N], col[N];

struct SGT {
    int sz[N << 2];
    void modify(int x, int l, int r, int p, int v) {
        if (l == r) {
            sz[x] = v; return;
        }
        int mid = (l + r) >> 1;
        p <= mid ? modify(x << 1, l, mid, p, v) : modify(x << 1 | 1, mid + 1, r, p, v);
        sz[x] = sz[x << 1] + sz[x << 1 | 1];
    }
    int query(int x, int l, int r, int lx, int rx) {
        if (rx < l || lx > r) return 0;
        if (lx <= l && r <= rx) return sz[x];
        int mid = (l + r) >> 1;
        return query(x << 1, l, mid, lx, rx) + query(x << 1 | 1, mid + 1, r, lx, rx);
    }
} T;

int main() {
    cin >> n;
    rep(i, 1, n) fa[i] = i;
    col[1] = 1;
    rep(i, 2, n) {
        for (int j = 1; j * j <= i; j++) {
            if (i % j == 0) {
                int x = j, y = i / j;
                T.modify(1, 1, n, col[x], 1);
                T.modify(1, 1, n, col[y], 1);
            }
        }
        int l = 1, r = n, pos = n;
        while (l <= r) {
            int mid = (l + r) >> 1;
            if (T.query(1, 1, n, 1, mid) < mid) pos = mid, r = mid - 1;
            else l = mid + 1;
        }
        col[i] = pos;
        for (int j = 1; j * j <= i; j++) {
            if (i % j == 0) {
                int x = j, y = i / j;
                T.modify(1, 1, n, col[x], 0);
                T.modify(1, 1, n, col[y], 0);
            }
        }
    }
    rep(i, 1, n) printf("%d ", col[i]); puts("");
    return 0;
}

#include <bits/stdc++.h>
using namespace std;

int main() {
	int n; cin >> n;
	for (int i=1; i<=n; i++)
		cout << int(log2(i))+1 << " ";
    return 0;
}