uses crt;
var a: array[1..100] of integer;
n,s1,s2,i: integer;
begin
clrscr;
write ('nhap n: '); readln (n);
for i:=1 to n do
begin
write ('nhap a[',i,']: '); readln (a[i]);
if a[i]<0 then s1:=s1+a[i];
if a[i] mod 2=0 then s2:=s2+a[i];
end;
writeln ('tong cac so am la: ',s1);
writeln ('tong cacso chia het cho 2: ',s2);
readln;
end.