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

c = []

for i in range(n):

    c1,t1 = list(map(int,input().split()))

    if t1 <= t:

        c.insert(i,c1)

if len(c) == 0:

    print("TLE")

else:

    c.sort(key=int)

    print((c[0]))
n,t = list(map(int,input().split()))

c = []

for _ in range(n):

    c1,t1 = list(map(int,input().split()))

    if t1 <= t:

        c.append(c1)

if len(c) == 0:

    print("TLE")

else:

    c.sort(key=int)

    print((c[0]))
n, t = list(map(int, input().split()))
c = []
for i in range(n):
    c1, t1 = list(map(int, input().split()))
    if t1 <= t:
        c.insert(i, c1)
if len(c) == 0:
    print("TLE")
else:
    c.sort(key=int)
    print((c[0]))

n, t = list(map(int, input().split()))
c = []
for _ in range(n):
    c1, t1 = list(map(int, input().split()))
    if t1 <= t:
        c.append(c1)
if len(c) == 0:
    print("TLE")
else:
    c.sort(key=int)
    print((c[0]))

-for i in range(n): +for _ in range(n): -        c.insert(i, c1) +        c.append(c1)