const xl=3;
yl=3;
var matr : array [1..xl,1..yl] of integer;
var maxlong,id,long,i,j : integer;
begin
maxlong:=0;
id:=1;
for i:= 1 to yl do
for j:= 1 to xl do
read(matr[j,i]);
for i:= 2 to yl do begin
long:=0;
for j:= 1 to xl do
long:= long+abs(matr[j,i])*abs(matr[j,1]);
if long>=maxlong then begin
maxlong:=long;
id:=i;
end;
end;
write(id);
readln;
end.