#include<iostream>
using namespace std;
int main(){
	int n,e[1010]={},p[1010]={},q[1010]={},i,count;
	while(1){
		cin>>n;
		if(n==0)break;
		count=0;
		for(i=0;i<n;i++){
			cin>>e[i]>>p[i]>>q[i];
			if(p[i]*q[i]>=100000){
				cout<<e[i]<<endl;
				count++;
			}
		}
		if(count==0){
			cout<<"NA"<<endl;
		}
	}
	return 0;
}

