#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
#include <string>
#include <cmath>
#include <queue>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
const int INF = 1<<30;

int main() {
  int l;
  while(cin >> l) {
    bool f = 0;
    int a[13], b[13];
    REP(i,13) {
      cin >> a[i] >> b[i];
    }
    REP(i,12) {
      l -= a[i]-b[i];
      if (l <= 0) {
        cout << i+1 << endl;
        f = 1;
        break;
      }
    }
    if (!f) {
      cout << "NA" << endl;
    }
  }
}