#include<bits/stdc++.h> using namespace std; int main(){ int week[7]; int a,b,max,z; bool f=1; for(int i=0;i<7;i++){ cin>>a>>b; week[i]=a+b; } max=week[0]; for(int i=0;i<7;i++){ if(week[i]>max){ max=week[i]; f=0; } } for(int i=0;i<7;i++){ if(week[i]==max){ z=i; break; } } if(f){ cout<<0; }else{ cout<<z+1; } return 0; }