#include <iostream>
using namespace std;

int main()
{
	int l, m, n, mu, f;

	while (cin >> l, l){
	mu = f = 0;
		for (int i = 0; i < 12; i++){
			cin >> m >> n;
			l -= (m - n);
			if (l <= 0 && f == 0){
				mu = i + 1;
				f = 1;
			}	
		}
		if (mu != 0) cout << mu << endl;
		else cout << "NA" << endl;
	}
	return (0);
}