#include<iostream>
using std;

int main(){
 int id,price,num,count;
 bool isBe=false;
 while(true){
  cin>>count;
  if(count==0){
   break;
  }
  for(int i=0;i<count;i++){
   cin>>id>>price>>num;
   if(price*num>=100000){
    cout<<id<<'\n';
    isBe=true;
   }
  }
  if(!isBe){
   cout<<"NA\n";
  }
  count=0;
  isBe=false;
 }
 return 0;
}