#include<iostream>
#include<math.h>
using namespace std;
int main()
{
	int n,b,t,ban;
	float y,r,data,max_m;
	while(1){
		max_m = 0.0;
		cin >> n;
		if(n == 0) break;
		cin >> y;
		for(int i=0;i<n;i++){
			cin >> b >> r >> t;
			if(t == 1)
				data = 1.0 + y * (r/100.0);
			else
				data = pow( 1+(r/100), y);
			if(max_m < data){
				ban = b;
				max_m = data;
			}
			//cout << "data = " << data << endl;
		}
		cout << ban << endl;
	}
	return 0;
}