#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  
  int L;
  while (cin >> L, L) {
    int M[12], N[12];
    for (int i = 0; i < 12; i++) {
      cin >> M[i] >> N[i];
    }
    int sum = 0, ans = -1;
    for (int i = 0; i < 12; i++) {
      sum += M[i] - N[i];
      if (sum >= L) {
        ans = i + 1;
        break;
      }
    }
    if (ans < 0) cout << "NA" << endl;
    else cout << ans << endl;
  }

  return 0;
}
