let () =
  Scanf.scanf "%d %d\n"
    (fun n time ->
       let f lst (c, t) = if t <= time then c :: lst else lst in
       Array.init n (fun _ ->
           Scanf.scanf "%d %d\n" (fun cc tt -> (cc, tt)))
       |> Array.fold_left f []
       |> List.fold_left min 2000)
  |> (fun m -> if m = 2000 then "TLE" else string_of_int m)
  |> print_string