#include<iostream>
using namespace std;
int main(){
  
  int i,l,a,b,m[15],sum;
  
  while(cin >> l,l!=0){
    for(i=0;i<12;i++){
      cin >> a >> b;
      m[i] = a-b;
    }
    m[13] = l;
    
    sum = 0;
    for(i=0;i<=12;i++){
      sum += m[i];
      if(sum >= l){
	if(i == 12) cout << "NA" << endl;
	else cout << i+1 << endl;
	break;
      }
    }
  }
  return(0);
}

