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

for i in range(n):

  a,b=list(map(int,input().split()))

  if b<=t:

    c.append(a)

if c==[]:print("TLE")

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

ans=10**9

for i in range(n):

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

  if tt<=t:ans=min(ans,c)

if ans==10**9:print("TLE")

else:print(ans)
n, t = list(map(int, input().split()))
c = []
for i in range(n):
    a, b = list(map(int, input().split()))
    if b <= t:
        c.append(a)
if c == []:
    print("TLE")
else:
    c.sort()
    print((c[0]))

n, t = list(map(int, input().split()))
ans = 10**9
for i in range(n):
    c, tt = list(map(int, input().split()))
    if tt <= t:
        ans = min(ans, c)
if ans == 10**9:
    print("TLE")
else:
    print(ans)

-c = [] +ans = 10**9 -    a, b = list(map(int, input().split())) -    if b <= t: -        c.append(a) -if c == []: +    c, tt = list(map(int, input().split())) +    if tt <= t: +        ans = min(ans, c) +if ans == 10**9: -    c.sort() -    print((c[0])) +    print(ans)