### main

while true
  n = gets.strip.to_i
  break if n == 0

  y = gets.strip.to_i

  max_or = 0.0
  max_b = nil

  n.times do
    b, r, t = gets.strip.split(' ').map{|s| s.to_i}

    if t == 1
      orr = 1 + y * r * 0.01
    else
      orr = (1 + r * 0.01) ** y
    end

    if max_or < orr
      max_or = orr
      max_b = b
    end
  end

  puts max_b
end