uses crt;
var n,i,t,t2,min,max,x,y:integer;
a:array[1..100] of integer;
begin
clrscr;
write('nhap n:');readln(n);
t:=0;t2:=0;min:=0;max:=0;
for i:=1 to n do
begin
write('Nhap pt thu ',i,':');readln(a[i]);
t:=t+a[i];//cau a
if a[i]<0 then t2:=t2+a[i];//cau b
if a[i]>=max then//cau c
begin
max:=a[i];
x:=i;//x chi so cau c
end;
if a[i]<=min then//cau d
begin
min:=a[i];
y:=i;//y chi so cau d
end;
end;
writeln('tong la :',t);
writeln('tong am la :',t2);
writeln('so lon nhat: ',max,' tai chi so ',x);
writeln('so be nhat: ',min,' tai chi so ',y);
end.