#include<iostream>
using namespace std;

int main() {
	int l;
	while (cin >> l, l) {
		int a[12][2];
		for (int i = 0;i < 12;i++) {cin >> a[i][0] >> a[i][1];}
		int c = 0;
		int m = 0;
		int flg = 1;

		for (int i = 0;i < 12;i++) {
			c += a[i][0] - a[i][1];
			m++;
			if (c >= l) {
				flg = 0;
				break;
			}
		}

		if (flg == 1)cout << "NA" << endl;
		else cout << m << endl;
	}
	return 0;
}