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



ans = 1001

for i in range(N):

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

    if t<=T and c < ans:

        ans = c



if ans >1000:

    print("TLE")

else:

    print(ans)

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

c_ok=[]



for i in range(N):

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

    if t<=T :

        c_ok.append(c)



if c_ok==[]:

    print("TLE")

else:

    print((min(c_ok)))

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

N, T = list(map(int, input().split()))
c_ok = []
for i in range(N):
    c, t = list(map(int, input().split()))
    if t <= T:
        c_ok.append(c)
if c_ok == []:
    print("TLE")
else:
    print((min(c_ok)))

-ans = 1001 +c_ok = [] -    if t <= T and c < ans: -        ans = c -if ans > 1000: +    if t <= T: +        c_ok.append(c) +if c_ok == []: -    print(ans) +    print((min(c_ok)))