#include <stdio.h>
#include <math.h>
#include <algorithm>

using namespace std;

const double BASE = 100;

int main(){

	int n,year,id,type,max_id;
	double r,max_rate,tmp;

	while(true){
		scanf("%d",&n);
		if(n == 0)break;

		scanf("%d",&year);

		max_rate = 0;

		for(int i = 0; i < n; i++){
			scanf("%d %lf %d",&id,&r,&type);
			if(type == 1){
				tmp = BASE*((100+year*r)/100);
				if(tmp > max_rate){
					max_rate = tmp;
					max_id = id;
				}
			}else{
				tmp = BASE*pow(((100+r)/100),year);
				if(tmp > max_rate){
					max_rate = tmp;
					max_id = id;
				}
			}
		}
		printf("%d\n",max_id);
	}
    return 0;
}