#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <cmath>

using namespace std;

int main() {
    int n, y;

    while (cin >> n, n) {
        cin >> y;
        vector<pair<long double, int> > bank(n);
        for (int i = 0; i < n; i++) {
            int b, r, t;
            cin >> b >> r >> t;
            long double res = 0;
            if (t == 1) {
                res = 1 * (1 + y * (long double)r / 100.0);
            } else {
                res = pow(1 + (long double)r / 100.0, y);
            }

            bank[i] = make_pair(res, b);
        }
        sort(bank.begin(), bank.end());
        cout << bank[n - 1].second << endl;
    }
    
    return 0;
}