#include <iostream>
using namespace std;

int main()
{
	while(true){
		int n;
		cin >> n;
		if(n==0)
			break;

		int y;
		double sum;
		int num=0;
		double max=0.0;

		cin >> y;

		for(int i=0 ;i<n ;i++){
			int b,r,t;
			cin >> b >> r >> t;

			if(t==1){
				sum = 1.0+(double)y*(double)r/100.0;
			}
			else{
				sum = 1.0;
				for(int j=0 ;j<y ;j++){
					sum *= 1.0+(double)r/100.0;
				}
			}

			if(max < sum){
				max = sum;
				num = b;
			}
		}
		cout << num << endl;
	}
	return 0;
}