#include<iostream>

using namespace std;
int main()
{
	int l;
	while (cin >> l&&l) {
		int m[12] = {};
		int n[12] = {};
		int cho = 0;
		int tuki = 0;
		for (int i = 0; i < 12;i++) {
			cin >> m[i] >> n[i];
		}
		for (int i = 0; i < 12; i++) {
			cho += m[i] - n[i];
			if (cho >= l) {
				tuki = i+1;
				break;
			}
		}
		if (tuki == 0) {
			cout << "NA" << endl;
		}
		else {
			cout << tuki << endl;
		}
	}

	return 0;
	
}