#include <iostream>
using namespace std;
int main() {
  
  int n,y;
  int b,r,t;

  while(1) {
  cin >> n;
  if(n == 0) break;
  cin >> y;

  double minx=-1;
  int ans = 0;  
  for(int i=0;i<n;i++) {
    cin >> b >> r >> t;

    double a = 1; 
    if(t == 1) {
      a = 1+y*(r/100.0);
    }
    else{
      for(int j=0;j<y;j++) {
	a *= (1+(r/100.0));
      }

    }    
    //cout << a << endl;
    if(minx < a) {
      minx = a;
      ans = b;
    }

  }
  cout << ans << endl;

  }

  return 0;

}
  