#include<iostream>using namespace std;int main(){int a,b,i=0,max=8,maxi=0;while(cin>>a>>b){i++;if(a+b>max) {max=a+b; maxi=i;}if(i==7) {cout<<maxi<<endl; i=0; max=8; maxi=0;}}}