uses crt;
var a:array[1..10000] of longint;
var i,n,d,k:longint;
begin
writeln('nhap n=');read(n);
for i:=1 to n do
begin
writeln('a[',i,']=');read(a[i]);
end;
for i:=1 to n do d:=d+a[i];
k:=1;
for i:=1 to n do begin if k<a[i] then k:=a[i]; end;
writeln('tong=',d);
writeln('gtln=',k);
readln;
end.