N, T = list(map(int, input().split()))

ans = 1001

for i in range(N):

    tmp = list(map(int, input().split()))

    if tmp[1] <= T:

        ans = min(ans, tmp[0])



print((ans if ans != 1001 else "TLE"))

N, T = list(map(int, input().split()))



ans = 1001

for _ in range(N):

    c, t = list(map(int, input().split()))

    if t <= T:

        ans = min(c, ans)



if ans == 1001:

    print('TLE')

else:

    print(ans)

N, T = list(map(int, input().split()))
ans = 1001
for i in range(N):
    tmp = list(map(int, input().split()))
    if tmp[1] <= T:
        ans = min(ans, tmp[0])
print((ans if ans != 1001 else "TLE"))

N, T = list(map(int, input().split()))
ans = 1001
for _ in range(N):
    c, t = list(map(int, input().split()))
    if t <= T:
        ans = min(c, ans)
if ans == 1001:
    print("TLE")
else:
    print(ans)

-for i in range(N): -    tmp = list(map(int, input().split())) -    if tmp[1] <= T: -        ans = min(ans, tmp[0]) -print((ans if ans != 1001 else "TLE")) +for _ in range(N): +    c, t = list(map(int, input().split())) +    if t <= T: +        ans = min(c, ans) +if ans == 1001: +    print("TLE") +else: +    print(ans)