#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, num, ch;
  unsigned long t, k;
  while (cin >> n) {
    ch = 0;
    while (n) {
      scanf("%d %ld %ld", &num, &t, &k);
      if (k != 0) {
        if (t > 1000000 / k) {
          ch++;
        } else if ((t == 1000000 / k) && (1000000 % k == 0)) {
          ch++;
        }
        if (((--n) == 0) && (ch == 0)) {
          cout << "NA" << endl;
        }
      }
    }
  }
  return 0;
}
