#include <iostream>
using namespace std;
#define MN 12

int main() {
	int l, m[MN], n[MN];
	while (cin >> l, l) {
		for (int i=0; i<MN; i++)
			cin >> m[i] >> n[i];

		int sum = 0;
		int ans=-1;
		for (int i=0; i<MN; i++) {
			sum += m[i]-n[i];
			if (sum >= l) { ans=i+1; break; }
		}

		if (ans!=-1)
			cout << ans << endl;
		else
			cout << "NA" << endl;
	}
	return 0;
}