#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const int INF = 1001001001;
const double EPS = 1e-10;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    while(cin>>n&&n){
        int y;
        cin>>y;
        int idx,maxv=-1;
        for(int i=0,b,r,t;i<n;i++){
            cin>>b>>r>>t;
            double m=10000;
            if(t==1)m=m*(1+y*(r/100.0));
            else m=m*pow((1+(r/100.0)),y);
            if(maxv<m){
                maxv=m;
                idx=b;
            }
        }
        cout<<idx<<endl;
    }
}
