#include <bits/stdc++.h>
using namespace std;

bool solve(){
    int n;
    cin >> n;
    if(n == 0) return false;
    int y, b, t;
    double r, maxi = 0;
    cin >> y;
    int ans = 0;
    for(int i=0;i<n;i++){
        cin >> b >> r >> t;
        double tmp;
        if(t == 1){
            tmp = (1.0+y*(r/100));
        }else{
            tmp = pow(1.0+(r/100), y);
        }
        if(tmp > maxi){
            maxi = tmp;
            ans = b;
        }
    }
    cout << ans << endl;
    return true;
}

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

