N = tonumber(io.read())
T = tonumber(io.read())

max = 2000
cnt = 0
ans = max
while cnt < N do
      c = tonumber(io.read())
      t = tonumber(io.read())
      if t < N and c < ans then
         ans = c
      end
      cnt = cnt + 1
end

if ans >= max then
  e1 = "TLE"
  print(e1)
else
  print(ans)
end