// AOJ 0240
#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>

using namespace std;

int main()
{
	int n, y;
	while (cin >> n, n){
		cin >> y;
		double r, t;
		int b;
		vector < pair <double, int> > d;
		for (int i = 0; i < n; i++){
			cin >> b >> r >> t;
			double p = r / 100.0;
			if (t == 1){
				d.push_back(make_pair(1 + (y * p), b));
			}
			else {
				d.push_back(make_pair(pow(1 + p, y), b));
			}
		}
		sort(d.rbegin(), d.rend());
		cout << d[0].second << endl;
	}

	return 0;
}