const
inf='sorttest.in';
ouf='sorttest.out';
var
n,i:longint;
a:array[1..2000000]of longint;
procedure kuaipai(l,r:longint);
var i,j,mid,t:longint;
begin
i:=l; j:=r;
mid:=a[(i+j) shr 1];
repeat
while a[i]<mid do inc(i);
while a[j]>mid do dec(J);
if i<=j then begin
t:=a[i]; a[i]:=a[j]; a[j]:=t;
inc(i); dec(j);
end;
until i>J;
if i<r then kuaipai(i,r);
if l<j then kuaipai(l,j);
end;
begin
assign(input,inf); reset(input);
assign(output,ouf); rewrite(output);
readln(n);
for I:=1 to n do read(a[i]);
kuaipai(1,n);
for I:=1 to n do write(a[i],' ');
close(input); close(output);
end.