#include<iostream> int main(){ int a,b,c,max=0; for(int t=1;t<8;t++){ std::cin>>a>>b; if(a+b>8)if(a+b>max)max=a+b,c=t; } std::cout<<c; return 0; }