Program HOC24;
var i,n: integer;
a: array[1..32000] of integer;
ta,td: longint;
begin
write('Nhap so phan tu: '); readln(n);
for i:=1 to n do
begin
write('a[',i,']='); readln(a[i]);
end;
ta:=0; td:=0;
for i:=1 to n do
begin
if a[i]>0 then td:=td+a[i];
if a[i]<0 then ta:=ta+a[i];
end;
writeln('Tong nguyen duong la: ',td);
writeln('Tong nguyen am la: ',ta)
readln
end.