open Printf
open Scanf

let id x = x
let pair x y = x, y

let n, t = scanf "%d %d" pair

let vs = Array.init n (fun _ -> scanf " %d %d" pair)

let f c' t' = if t' <= t then c' else 2000

let () =
  Array.sort (fun (ac, at) (bc, bt) -> f ac at - f bc bt) vs;
  let (a, b) = vs.(0) in
  if b <= t then printf "%d\n" a else printf "TLE\n"
