#include <iostream>
using namespace std;
int main( void )
{
	int L;
	while ( cin >> L && L )
	{
		int kotae = 0;
		int now = 0;
		int M, N;
		for ( int i = 0; i < 12; i++ )
		{
			cin >> M >> N;

			now += M - N;
			if ( kotae == 0 && now >= L )
			{
				kotae = i + 1;
			}
		}

		if ( kotae )
			cout << kotae << endl;
		else
			cout << "NA" << endl;
	}

	return 0;
}