#include<iostream>
#include<cmath>
using namespace std;
int main() {
	double  n, y;
	while (cin >> n&&n != 0) {
		cin >>  y;
		double a[2]{ 0,0 };
		for (int i = 0; i < n; i++) {
			double b, c, d;
			cin >> b >> c >> d;
			if (d == 1) {
				double  e = 10000 * (1 + y*c / 100);
				if (a[1] < e) {
					a[0] = b;
					a[1] = e;
				}
			}
			else {
				double e = 10000 * (pow((1 + (c / 100)), y));
				if (a[1] < e) {
					a[0] = b;
					a[1] = e;
				}
			}
		}
		cout << a[0] << endl;
	}
}