#include <iostream>

using namespace std;

int main(int argc, char const* argv[])
{
	int L,N,M;
	int sum;
	int answer;

	while( cin >> L && L != 0 ){
		sum = 0;
		answer = 0;
		for( int i = 0;i < 12;i++ ){
			cin >> M >> N;
			sum += M - N;
			if( sum >= L && answer == 0 ) answer = i + 1;
		}
		if( answer != 0 ) cout << answer << endl;
		else cout << "NA" << endl;
	}

	return 0;
}