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) cnt = [N] * (NN+1) for a in C: x = C[a] for d in range(1, a+1): if d * d > a: break if a % d == 0: cnt[d] -= x if d * d != a: cnt[a // d] -= x 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()