#include<iostream>
#include<algorithm>
#include<set>
#include<map>
#include<vector>
#include<queue>
#include<cstring>
#include<cmath>
#include<cstdio>
#include<cstdlib>
using namespace std;
#define REP(i,a,n) for(int i = a ; i < n ; i++)
#define rep(i,n) REP(i,0,n)

typedef long long ll;

int L;
int up[12];

void solve(){
  int now = 0;

  rep(i,12){
    now += up[i];
    if(now >= L){
      cout<<i+1<<endl;
      return;
    }
  }
  cout<<"NA\n";
}

int main(){
  while(cin>>L,L){
    rep(i,12){
      int n,m;
      cin>>n>>m;
      up[i] = n - m;
    }
    solve();
  }
}