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

int main()
{
	int n,b,t,maxNO,i;
	double y,r,money,max;

	scanf("%d",&n);
	while(n != 0){
		max = 0;

		scanf("%lf",&y);
		for(i = 0; i < n; i++){
			scanf("%d%lf%d",&b,&r,&t);
			if(t == 1){
				money = 1.0 + y * (r/100);
				//printf("%lf\n",money);
			}
			else{
				money = pow((1.0 + r/100.0),y);
				//printf("%lf\n",money);
			}
			if(money > max){
				max = money;
				maxNO = b;
			}
		}

		printf("%d\n",maxNO);

		scanf("%d",&n);
	}

	return 0;
}