import Control.Applicative

main :: IO ()
main = do
  { [n, t] <- readLineInputs
  ; pc <- loop t 1001 n
  ; putStrLn $ if pc == 1001 then "TLE" else show pc
  }

loop :: Int -> Int -> Int -> IO Int
loop _ pc 0 = return pc
loop lt pc n = do
  { [cc, ct] <- readLineInputs
  ; if ct <= lt then loop lt (min pc cc) (pred n) else loop lt pc (pred n)
  }

readLineInputs :: Read a => IO [a]
readLineInputs = map read . words <$> getLine
