import std.stdio, std.string, std.conv, std.algorithm, std.math;

void main()
{
    while(true)
    {
        int n = readln.chomp.to!int;
        if(!n)break;

        int y = readln.chomp.to!int;
        real max = 0;
        int maxBank;
        foreach(_; 0 .. n)
        {
            auto inp = readln.split.map!(to!int);
            int b = inp[0],
                r = inp[1],
                t = inp[2];
            real sum;
            final switch(t)
            {
                case 1:
                    sum = (1 + y * r / 100.0);
                    break;
                case 2:
                    sum = (1 + r / 100.0) ^^ y;
                    break;
            } 
            if(sum > max)
            {
                max = sum;
                maxBank = b;
            }
        }
        maxBank.writeln;
    }
}