#================================================== import sys input=sys.stdin.readline write=sys.stdout.write N=int(input()) A=list(map(int,input().split())) alpha=max(A) T=[0]*(alpha+1) for a in A: T[a]+=1 X=[0]*(N+1) for g in range(1,alpha+1): k=sum(T[g::g]) X[N-k]=g for i in range(1,N+1): X[i]=max(X[i-1],X[i]) write("\n".join(map(str,X[:-1])))