#include <bits/stdc++.h>
int main(void) {
  int hito, i, c, ris;
  scanf("%d", hito);
  int ban[hito], ka[hito], age[hito];
  for (i = 0; i < hito; i++) {
    scanf("%d %d %d", &ban[i], &ka[i], &age[i]);
  }
  for (i = 0; i < hito; i++) {
    ris = ka[i] * age[i];
    if (1000000 <= ris) {
      printf("%d\n", ban[i]);
      c = 1;
    }
  }
  if (c = 1) printf("NA\n");
  return 0;
}
