#include <algorithm>
#include <cctype>
#include <cstdio>
#include <cmath>
#include <iostream>
#include <functional>
#include <queue>
#include <string>
#include <map>
#include <vector>

using namespace std;

int main() {
  for (;;) {
    int n, B, y;
    cin >> n;
    if (!n) return 0;
    cin >> y;
    double m = 0;
    for (int i = 0; i < n; i++) {
      int b, t;
      double x, r;
      cin >> b >> r >> t;
      if (t == 1)
        x = 1 + y * r / 100;
      else
        x = pow(1 + r / 100, y);
      if (m < x) {
        m = x;
        B = b;
      }
    }
    cout << B << endl;
  }
}