#include<stdio.h>
int main(void)
{
	int n,y,b,r,t,i,k,a,z;
	double x;
	scanf("%d %d",&n,&y);
	while(n!=0){
		a=0;
		z=0;
		for(i=0;i<n;i++){
			scanf("%d %d %d",&b,&r,&t);
			if(t==1){
				x=(double)10000*(100+y*r)/100;
//				printf("b=%d 1x=%lf\n",b,x);
			}
			else{
				x=10000;
				for(k=0;k<y;k++)  {
					x=(double)x*(100+r)/100;
//					printf("x=%lf\n",x);
				}
//				printf("b=%d 2x=%lf\n",b,x);
			}
			if(z<x){
				a=b;  z=x;
			}
		}
		printf("%d\n",a);
		scanf("%d %d",&n,&y);
	}
	return 0;
}