Var n,i,s1,s2: integer; a: array [1..32767] of integer;
begin
readln(n);
s1:=0;
s2:=0;
for i:=1 to n do read(a[i]);
for i:=1 to n do begin
if (a[i]<0) and (i mod 2=0) then s1:=s1+a[i]<br>end;
for i:=1 to n do begin
if (a[i]<0) and (i mod 2<>0) then s2:=s2+a[i]
end;
writeln(s1);
writeln(s2);
end.