import sys, time, random from collections import deque, Counter, defaultdict input = lambda: sys.stdin.readline().rstrip() ii = lambda: int(input()) mi = lambda: map(int, input().split()) li = lambda: list(mi()) inf = 2 ** 63 - 1 mod = 998244353 n = ii() D = [[] for _ in range(n + 1)] s = [] for i in range(1, n + 1): now = i for j in range(2, now + 1): if j * j > now: break while now % (j * j) == 0: now //= (j * j) D[now].append(i) s.append(now) ans = [] for i in range(n): ans.append(D[s[i]].pop()) print(*ans)