#include <iostream>
#include <math.h>
#include <algorithm>
using namespace std;
int main(void){
    int n,year,id,type,maxid;
    double r,maxrate,tmp;
    while(true){
        cin >> n;
        if(n==0)break;
        cin >> year;
        maxrate=0;
        for(int i=0;i<n;i++){
            cin >> id >> r >> type;
            if(type == 1){
                tmp = 100*((100+year*r)/100);
                if(tmp > maxrate){
                    maxrate = tmp;
                    maxid = id;
                }
            }else{
                tmp = 100*pow(((100+r)/100),year);
                if(tmp > maxrate){
                    maxrate = tmp;
                    maxid = id;
                }
            }
        }
        cout << maxid << endl;
    }
    return 0;
}
