#include <iostream>
#include <cmath>
using namespace std;
int main(void){
    int n,y;
    int b[110],r[110],t[110];
 
    while(true){
        cin >> n;
        cin >> y;
        if(n == 0){
            break;
        }
        for(int i = 0; i < n; i++){
            cin >> b[i] >> r[i] >> t[i];
        }
 
        double ganri[110];
        double ganri_max = 10000;
        int number;
 
        for(int i = 0; i < n; i++){
            if(t[i] == 1){
                ganri[i] = 10000*(1 + y*(double)r[i]/100);
            }
            else{
                ganri[i] = 10000*pow(1 + (double)r[i]/100, y);
            }
            if(ganri[i] > ganri_max){
                ganri_max = ganri[i];
                number = b[i];
            }
        }
        cout << number << endl;
    }
}
