#include <bits/stdc++.h>
void search(struct data *s, int t);
struct data {
  int a;
  int b;
  int c;
};
int main(void) {
  struct data base[50];
  int n, i;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d %d %d", &base[i].a, &base[i].b, &base[i].c);
  }
  search(base, n);
  return 0;
}
void search(struct data *s, int t) {
  int u, i;
  for (i = 0; i > t; i++) {
    u = (s->b) * (s->c);
    if (u >= 1000000) {
      printf("%d\n", s->a);
    }
    s++;
  }
}
