n=gets.to_i
a=gets.split.map(&:to_i).each_with_object({}){|i,t| t[i]||=0;t[i]+=1; }.values.sort.reverse

sum=a.reduce(:+)

(1..n).each{|t|
    r = a.reduce([[0]*t]){|memo,i|
        memo.flat_map{|x|
            (0...x.size).each_with_object([]){|idx,tt|
                if x[idx] < sum/t + 1
                    tmp = x.dup;
                    tmp[idx] += i 
                    tt << tmp
                end
            }
        }
    }
    p r.map(&:min).max
}
