object Main {
  def main(args:Array[String]) {
    var count = 0
    var max_time = 0
    var min_cost = 1001
    for(line <- io.Source.stdin.getLines()) {
	  val factors = line.split(" ").map{_.toInt}
	  if(count == 0) {
	    max_time = factors(1)
	  }
	  else {
  	    if(factors(1) <= max_time) {
	      if(factors(0) < min_cost) {
		    min_cost = factors(0)
		  }
	    }
	  }
      count += 1
	}
	if(min_cost == 1001) {
	  println("TLE")
	}
	else {
	  println(min_cost)
	}
  }
}