#include <iostream>
#include <cmath>

using namespace std;

void solve()
{
	int n;
	while(cin >> n, n)
	{
		int y;
		cin >> y;
		int ans = 0;
		double max = 0;
		for(int i = 0; i < n; ++i)
		{
			int b, r, t;
			cin >> b >> r >> t;
			double sum = 1;
			if(t == 1)
			{
				sum = 1 + y * r / 100.0;
			}
			else
			{
				sum = pow(1 + r / 100.0, y);
			}
			if(sum > max)
			{
				ans = b;
				max = sum;
			}
		}
		cout << ans << endl;
	}
}

int main()
{
	solve();
	return(0);
}