object Main extends App {
  import scala.io.StdIn.readLine
  val (rows, time) = readLine.split(" ").map(_.toInt).toList match {
    case h :: t :: Nil => (h,t)
  }
  val table = (for(i <- 1 to rows) yield readLine.split(" ").map(_.toInt).toList).zipWithIndex
  val result = table.filter(l => l._1.reverse.head < time).sortBy(_._1.head).headOption
  println(result.map(_._2.toString).getOrElse("TLE"))
}
