import sys input = sys.stdin.readline from math import sqrt N=int(input()) A=list(map(int,input().split())) MAX=max(A) DIV=[-1]*(MAX+1) for i in range(2,MAX+1): for j in range(i,MAX+1,i): if DIV[j]==-1: DIV[j]=i def fac(x): X=dict() while x!=1: k=DIV[x] if k in X: X[k]+=1 else: X[k]=1 x//=k F=[1] for d in X: Y=[] for f in F: for i in range(X[d]): Y.append(f*pow(d,i+1)) F=F+Y return F LIST=[0]*(max(A)+1) for a in A: for x in fac(a): LIST[x]+=1 ANS=[0]*(N+1) now=1 for i in range(max(A),-1,-1): while LIST[i]>=now: ANS[now]=i now+=1 #print(*ANS) for i in range(N,0,-1): print(ANS[i])