var n,i,max,sa,sd,sk,j,t:longint;
b:array[1..10000] of longint;
begin
write('Nhap n '); readln(n);
write('Nhap mang B ');
for i:=1 to n do
read(b[i]);
{---Cau a---}
max:=0;
for i:=1 to n do
if b[i]>max then max:=b[i];
writeln('So lon nhat ',max);
{---Cau b---}
sa:=0;
sd:=0;
sk:=0;
for i:=1 to n do
begin if b[i]<0 then inc(sa);
if b[i]>0 then inc(sd);
if b[i]=0 then inc(sk); end;
writeln('So am ',sa);
writeln('So duong ',sd);
writeln('So khong ',sk);
{---Cau c---}
for i:=1 to n-1 do
for j:=i+1 to n do
if b[i]>b[j] then begin t:=b[i];
b[i]:=b[j];
b[j]:=t; end;
write('Mang sau khi sap xep ');
for i:=1 to n do
write(b[i],' ');
end.