#include<iostream>
#include<vector>
using namespace std;

int main(void){
     int n;
     cin >> n;
     vector<int> worker;
     for(int i=0;i<n;i++){
	  int q,w,e;
	  cin >> q >> w >> e;
	  if(1000000 <= w*e){
	       worker.push_back(q);
	  }
     }
     if(worker.size() == 0){
	  cout << "NA" << endl;
     }else{
	  for(int i=0;i<worker.size();i++){
	       cout << worker[i] << endl;
	  }
     }
     return 0;
}