#include <iostream>
#include <cmath>
using namespace std;

int main() {
	// your code goes here
	int n,y,b[100],r,t;
	double money[100];
	while(cin >> n >> y){
	if(n==0)
	break;

	int maxim=0;
	for(int i=0;i<n;i++){
		cin >> b[i] >> r >> t;
		if(t==1)
		money[i]=1+r*y/100.0;
		else
		money[i]=pow((100+r)/100.0,y);
	}
	for(int i=0;i<n;i++)
		if(money[maxim]<money[i])
		maxim=i;
		cout << b[maxim] << endl;
	}
	return 0;
}