#include<iostream> using namespace std; int main(){ int max=0,day=0; for (int i=1,x,y; i<=7; i++){ cin>>x>>y; if (x+y>max) max=x+y,day=i; } if (max<=8) day=0; cout<<day<<endl; return 0; }