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

src = [tuple(map(int,input().split())) for i in range(N)]

ans = 10**10

for c,t in src:

    if t <= T:

        ans = min(ans,c)

if ans == 10**10:

    print('TLE')

else:

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

src = [tuple(map(int,input().split())) for i in range(N)]



ans = 9999

for c,t in src:

    if t > T: continue

    ans = min(ans, c)

print((ans if ans < 9999 else 'TLE'))
N, T = list(map(int, input().split()))
src = [tuple(map(int, input().split())) for i in range(N)]
ans = 10**10
for c, t in src:
    if t <= T:
        ans = min(ans, c)
if ans == 10**10:
    print("TLE")
else:
    print(ans)

N, T = list(map(int, input().split()))
src = [tuple(map(int, input().split())) for i in range(N)]
ans = 9999
for c, t in src:
    if t > T:
        continue
    ans = min(ans, c)
print((ans if ans < 9999 else "TLE"))

-ans = 10**10 +ans = 9999 -    if t <= T: -        ans = min(ans, c) -if ans == 10**10: -    print("TLE") -else: -    print(ans) +    if t > T: +        continue +    ans = min(ans, c) +print((ans if ans < 9999 else "TLE"))