mod = 1000000007 eps = 10**-9 NN = 10 ** 6 def main(): import sys from collections import Counter input = sys.stdin.readline N = int(input()) A = list(map(int, input().split())) C = Counter(A) div = [[] for _ in range(NN + 1)] for i in range(201, NN+1): for x in range(1, NN+1): if i * x > NN: break if i * x in C: div[i*x].append(i) cnt = [N] * (NN+1) for a in C: k = C[a] for d in div[a]: cnt[d] -= k for d in range(1, 201): if a % d == 0: cnt[d] -= k ans = [1] * (N+1) for x in range(1, NN+1): k = cnt[x] ans[k] = x for i in range(1, N+1): ans[i] = max(ans[i], ans[i-1]) for i in range(N): print(ans[i]) if __name__ == '__main__': main()