#include <iostream>
#include <stdio.h>
#include <cmath>
using namespace std;
#define LL long long
int main()
{
int bgx[10]={0};
for(int i=1;i<=7;i++){
int a,b;
cin>>a>>b;
if(a+b>=8)
bgx[i]+=a+b;
}
int h=0;
for(int i=1;i<=7;i++){
if(bgx[h]<bgx[i]) h=i;
}
cout<<h;
return 0;
}
大佬们,救救我12WA了