require 'prime'
N, *A = $<.read.split.map(&:to_i)

h = Hash.new(0)
A.each{|a|
	h[a] += 1
}
B = h.values.sort

Ans = [nil]*N

(1..N).reverse_each{|k|
	next if Ans[k]
	next Ans[k] = 0 if B.size < k
	b, j = B.dup, 0
	while 1
		(b.size-k-1).downto(j){|l|
			b[(-k..-1).min_by{|i| b[i] }] += b[l]
		}
		Ans[k] = b[-k,k].min

		break if k == 1
		j = b.size-k
		k /= k.prime_division[0][0]
	end
}
Ans.shift
p *Ans
