uses crt;
var a: array[1..100] of longint;
i,n,max,min: longint;
begin
clrscr;
readln(n);
for i:=1 to n do
begin
write('Nhap so thu ',i,': ');
readln(a[i]);
end;
max:=a[1]; min:=a[1];
for i:=1 to n do
begin
if max<a[i] then max:=a[i];
if min>a[i] then min:=a[i];
end;
writeln('So lon nhat trong mang la: ',max);
write('So nho nhat trong mang la: ',min);
readln
end.