var a:array[1..100] of integer;
i,j,t,n: integer;
procedure Qshort(l,h: word);
var m: word;
begin
m:=A[(l+h) div 2];
i:=l; j:=h;
repeat
while a[i] < m do inc(i);
while a[j] >m do dec(j);
if a[i]<a[j] then
begin
t:=a[i]; a[i]:=a[j];
a[j]:=t;
inc(i); dec(j);
end;
until i>j ;
if l< i then Qshort(l,j);
if i< h then Qshort(i,h);
end;
begin
write(' nhap n='); readln(n);
for i:=1 to n do
begin
write('gia tri thu ',i,':'); readln(a[i]);
end;
Qshort(a[1],a[n]);
for i:=1 to n do
writeln(a[i]);
readln;
end.