import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, core.stdc.string, core.stdc.stdlib;

void main() {
    auto N = readln.chomp.to!int;
    auto A = readln.split.map!(to!int).array;

    int[int] D;
    foreach (a; A) D[a] += 1;

    auto B = D.values.array;
    B.sort!"a > b";
    auto M = B.length.to!int;
    auto sm = B.sum;
    auto mx = B.reduce!max;
    auto pq = new BinaryHeap!(Array!int, "a < b");
    foreach (b; B) pq.insert(b);

    auto C = new long[](N+1);
    foreach (i; 0..M) {
        C[0] += 1;
        C[B[i]] -= 1;
    }
    foreach (i; 0..N) C[i+1] += C[i];
    foreach (i; 0..N) C[i+1] += C[i];
    C = 0 ~ C;

    auto ans = new long[](N+1);
    foreach (i; 1..N+1) {
        auto x = (C[i] / i).to!int;
        ans[x] = max(ans[x], i);
    }

    foreach_reverse (i; 1..N+1) ans[i-1] = max(ans[i-1], ans[i]);
    ans[1..N+1].each!writeln;
}
