const fi='songuyen.dat'
fo='ketqua.dat'
var f1,f2:text;
a:array[1..100]of integer;
i,n,s,ln:integer;
begin
assign(f1,fi); reset(f1);
assign(f2,fo); rewrite(f2);
readln(f1,n);
for i:=1 to n do
read(f1,a[i]);
s:=1;
ln:=a[1];
for i:=1 to n do
begin
s:=s*a[i];
if ln<a[i] then ln:=a[i];
end;
writeln(f2,s);
writeln(f2,ln);
close(f1);
close(f2);
end.