Scanf.scanf "%d %d" (fun n t ->
    let ct = Array.init n (fun _ -> Scanf.scanf " %d %d" (fun c t -> c, t )) in

    let rec loop i c =
        if i = n then (if c = max_int then "TLE" else string_of_int c) else
            let c = if snd ct.(i) <= t then min c (fst ct.(i)) else c in
            loop (i + 1) c
    in
    loop 0 max_int |> print_endline
)