import scala.io.StdIn.{readInt,readLine}

object Main {
  def main(args:Array[String]) = {
    var n = 0
    while( {n=readInt;n} != 0 ) {
      val y = readInt.toDouble
      val rate = {
        for(i <- 1 to n) yield {
          val s = readLine.split(" ")
          if(s(2).toInt ==1) (s(0),1+y*s(1).toDouble/100)
          else (s(0), Math.pow(1+s(1).toDouble/100,y))
        }
      }.toList.maxBy(_._2)
      println(rate._1)
    }
  }
}