#include<iostream>
#include<cmath>
using namespace std;

int main() {
  int n, y, b[100], r, t;
  double money[100];
  while( cin >> n, n) {
    cin >> y;

    int maxim = 0;
    for(int i=0; i<n; i++) {
      cin >> b[i] >> r >> t;
      if( t == 1 ) money[i] = 1 + r*y/100.0;
      else money[i] = pow((100+r)/100.0, y); 
    }

    for(int i=1; i<n; i++) {
      if( money[maxim] < money[i] ) maxim = i;
    }
    cout << b[maxim] << endl;
  }
}