Uses crt;
var i,n,min,max: longint;
a: array[1..100] of longint;
begin clrscr;
readln(n);
for i:=1 to n do read(a[i]); readln;
writeln(a[i]:3)
max:=a[1];
for i:=1 to n do begin
if(max<a[i]) then max:=a[i];
end;
writeln(max);
min:=a[1];
for i:=1 to n do begin
if(min>a[i]) then min:=a[i];
end;
writeln(min);
readln;
end.