#include<iostream>
using namespace std;
int main()
{
int a,b;
int res=0;
int most=7;
int place;
for(int i=1;i<=7;i++)
{
cin>>a>>b;
if(a+b>most)
{
most=a+b;
place=i;
}
}
if(most==7) cout<<0;
else cout<<place;
return 0;
}