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

ts = []

for i in range(n):

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

    if c[1] <= t:

        ts.append(c[0])

if ts == []:

    print('TLE')

else:

    print((min(ts)))
n, t = list(map(int, input().split()))

stack =  []

for i in range(n):

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

    if ts <= t:

        stack.append(c)

print((min(stack) if stack != [] else 'TLE'))
n, t = list(map(int, input().split()))
ts = []
for i in range(n):
    c = list(map(int, input().split()))
    if c[1] <= t:
        ts.append(c[0])
if ts == []:
    print("TLE")
else:
    print((min(ts)))

n, t = list(map(int, input().split()))
stack = []
for i in range(n):
    c, ts = list(map(int, input().split()))
    if ts <= t:
        stack.append(c)
print((min(stack) if stack != [] else "TLE"))

-ts = [] +stack = [] -    c = list(map(int, input().split())) -    if c[1] <= t: -        ts.append(c[0]) -if ts == []: -    print("TLE") -else: -    print((min(ts))) +    c, ts = list(map(int, input().split())) +    if ts <= t: +        stack.append(c) +print((min(stack) if stack != [] else "TLE"))