#include <iostream>
#include <cmath>
using namespace std;
int main(void)
{
	int n, y, b[50], r[50], t[50], a;
	double s, m;

	while (cin >> n, n)
	{
		cin >> y;
		for (int i = m = a = 0; i < n; ++i)
		{
			cin >> b[i] >> r[i] >> t[i];
			if (t[i] == 1 && (s = 1.0 + y*r[i]/100.0) > m)	m = s, a = b[i];
			else if (t[i] == 2 && (s = pow(1.0 + r[i]/100.0, y)) > m)	m = s, a = b[i];
		}
		cout << a << endl;
	}
	return 0;
}