#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
double huku(int y,int r){ return pow((1.0+r/100.0),y); }
double tan(int y,int r){ return 1.0+y*r/100.0; }
int main(void)
{
	int n,y,num;
	double ritu,dritu;

	while(1){
		cin >> n;
		if(n==0) break;
		cin >> y;
		vector< vector<int> > bank(n,vector<int>(3));
		for(int i=0;i<n;i++) cin >> bank[i][0] >> bank[i][1] >> bank[i][2]; 
		ritu=0.0;
		for(int i=0;i<n;i++){
			dritu=(bank[i][2]==1?tan(y,bank[i][1]):huku(y,bank[i][1]));
			if(ritu<dritu){
				ritu=dritu;
				num=bank[i][0];
			}
		}
		cout << num << endl;
		bank.clear();
	}
	return 0;
}