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