#include<iostream>
#include<math.h>
#include<algorithm>
#include<string>
using namespace std;

int n,y;
double money[1001];
struct DATA{
int name,r,t;
double money;
};
DATA data[1001];

int main(){
	while(1){
		cin>>n;
		if(n==0){break;}
		cin>>y;
		for(int i=0;i<n;i++){
			cin>>data[i].name>>data[i].r>>data[i].t;
			if(data[i].t==1){data[i].money=(1.0+y*data[i].r/100.0);}
			if(data[i].t==2){data[i].money=pow(1.0+data[i].r/100.0,y);}
		}
		for(int i=0;i<n;i++){
			money[i]=data[i].money;
		}
		sort(money,money+n);
		for(int i=0;i<n;i++){
			if(money[n-1]==data[i].money){
				cout<<data[i].name<<endl;
				break;
			}
		}
	}
	return 0;
}