#include<iostream>
using namespace std;
double f(double k, int p) {
	if (p == 0)return 1;
	else return k*f(k, p - 1);
}
int main() {
	int n;
	while (cin >> n, n) {
		int y; cin >> y;
		double maxv = 0; int maxn;
		for (int i = 1; i <= n; i++) {
			int b, t; double r; cin >> b >> r >> t;
			double v;
			if (t == 1)v = 1 + y*r / 100;
			else v = f(1 + r / 100, y);
			if (v > maxv) { maxv = v; maxn = b; }
		}
		cout << maxn << endl;
	}
}