var a,i,x,y,d,max : byte;
begin
{assign(input,'unhappy.in'); reset(input);
assign(output,'unhappy.out'); rewrite(output); }
d := 0; max :=8;
for i := 1 to 7 do begin
readln(x,y);
a := x+y;
if a>max then
begin
max :=a; d := i;
end;
end;
writeln(d);
{close(input); close(output); }
end.
/**************************************************************
	Problem: 2244
	User: admin
	Language: Pascal
	Result: Wrong Answer
****************************************************************/