N = int(input())
A = list(map(int,input().split()))
from math import sqrt,ceil,floor
def yaku(n):#nの約数を列挙するn <= 10 ** 12(order)
    rev = []
    for i in range(1,int(n ** 0.5)+1):
        if n % i == 0:
            rev.append(i)
            if n //i == i:
                continue
            rev.append(n//i)
    rev = list(set(rev))
    return sorted(rev)
memo = [0 for _ in range(10** 6 + 1)]
for a in A:
    tmp = yaku(a)
    for n in tmp:
        memo[n] += 1
field = [0 for _ in range(N+1)]
for x in range(1,10**6+1):
    tmp = N - memo[x]
    field[tmp] = max(x,field[tmp])
def max_lift(List):
    rev = [0 for _ in range(len(List))]
    for i in range(len(List)):
        if i == 0:
            rev[i] = List[i]
        else:
            rev[i] = max(rev[i-1],List[i])
    return rev
ANS = max_lift(field)
for k in range(N):
    print(ANS[k])