import std.stdio,std.string,std.conv;int n,x,k;int[300999]C,U;void main(){readf("%d\n",&n);foreach(a;readln.split)C[a.to!int]++;foreach(c;C)for(x=0;c;)U[x++]+=c--;for(x=n;k<n;)k*x+x>n-U[x]&&x--||(k++,x.writeln);}