#include <iostream>
#include <vector>

using namespace std;

int n;
long long id[4000];
long long value[4000];
long long number[4000];

int main(){
    cin >> n;
    for(int i=0;i<n;i++){
        cin >> id[i] >> value[i] >> number[i];
    }
    vector<long long> v;
    for(int i=0;i<n;i++){
        if(value[i]*number[i] >= 1000000 ){
            v.push_back(id[i]);
        }
    }
    for (vector<long long>::iterator it=v.begin();it!=v.end();++it){
        cout << *it << endl;
    }
}