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

C=[list(map(int, input().split())) for _ in range(N)]

e=[]

for i in C:

  if T>=i[1]:

    e.extend([i[0]])

print(('TLE' if len(e)==0 else min(e)))
N,T=list(map(int,input().split()))

C=[list(map(int, input().split())) for _ in range(N)]

e=10000

for i in C:

  if T>=i[1] and e>i[0]:

    e=i[0]

print(('TLE' if e==10000 else e))
N, T = list(map(int, input().split()))
C = [list(map(int, input().split())) for _ in range(N)]
e = []
for i in C:
    if T >= i[1]:
        e.extend([i[0]])
print(("TLE" if len(e) == 0 else min(e)))

N, T = list(map(int, input().split()))
C = [list(map(int, input().split())) for _ in range(N)]
e = 10000
for i in C:
    if T >= i[1] and e > i[0]:
        e = i[0]
print(("TLE" if e == 10000 else e))

-e = [] +e = 10000 -    if T >= i[1]: -        e.extend([i[0]]) -print(("TLE" if len(e) == 0 else min(e))) +    if T >= i[1] and e > i[0]: +        e = i[0] +print(("TLE" if e == 10000 else e))