#include<cstdio>
#include<cmath>
#include<algorithm>
#include<utility>
#define rep(i,a) for( int i = 0; i != (a); ++i )

typedef std::pair<double, int> P;

int n;
double y;
P ans( 0, 0 );

int main()
{
	while( scanf( "%d", &n ), n )
	{
		ans = P( 0, 0 );
		scanf( "%lf", &y );
		
		rep( i, n )
		{
			int b, t;
			double r;
			scanf( "%d%lf%d", &b, &r, &t );
			--t;
			if( t )
				ans = std::max( ans, P( pow( 1.0+r/100.0, y ), b ) );
			else
				ans = std::max( ans, P( 1.0+y/100.0*r, b ) );
		}

		printf( "%d\n", ans.second );
	}

	return 0;
}