#include <iostream>
using namespace std;

int main(){
	int shotoku[12];
	int l,m,n;
	int i,total;
	cin>>l;
	for(i=0;i<12;i++){
		cin>>m>>n;
		shotoku[i]=m-n;
	}
	total=0;
	for(i=0;i<12;i++){
		total+=shotoku[i];
		if(l<=total){
			cout<<i+1;
			break;
		}
	}
	if(i==13) cout<<"NA";
	cout<<endl;
	return 0;
}