#include<bits/stdc++.h> using namespace std; int main() { int n=0; for(int i=1;i<=7;i++) { int x,k; cin>>x>>k; if(x+k>=n) { cout<<i; } } return 0; }