var a,b:array[1..3000000]of longint;
n,i:longint;
procedure merge(l,r:longint);
var t,i,j,mid:longint;
begin
t:=l;i:=l;j:=(l+r)>>1+1;mid:=j-1;
while t<=r do
begin
if (i<=mid)and((a[i]<a[j])or(j>r)) then
begin
b[t]:=a[i];
inc(i);
end
else
begin
b[t]:=a[j];
inc(j);
end;
inc(t);
end;
for i:=l to r do a[i]:=b[i];
end;
procedure fen(l,r:longint);
begin
if l<r then
begin
fen(l,(l+r)>>1);
fen((l+r)>>1+1,r);
merge(l,r);
end;
end;
begin
assign(input,'sorttest.in');reset(input);assign(output,'sorttest.out');rewrite(output);
readln(n);
for i:=1 to n do read(a[i]);
fen(1,n);
for i:=1 to n do write(a[i],' ');
close(input);close(output);
end.