#include <iostream>
#include <vector>

using namespace std;
typedef pair<int, int> P;

void solve()
{
	int L;
	while(cin >> L, L)
	{
		vector<P> Vec(12);
		for(int i = 0; i < 12; ++i)
		{
			cin >> Vec[i].first >> Vec[i].second;			
		}
		int sum = 0;
		for(int i = 0; i < 12; ++i)
		{
			sum += Vec[i].first - Vec[i].second;
			if(sum >= L)
			{
				cout << i + 1 << endl;
				goto NEXT;
			}
		}
		cout << "NA" << endl;
NEXT:
		;
	}
}

int main()
{
	solve();
	return(0);
}