When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC.
You, the smartwatch, has found N routes to his home.
If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i.
Find the smallest cost of a route that takes not longer than time T.

-----Constraints-----
 - All values in input are integers.
 - 1 \leq N \leq 100
 - 1 \leq T \leq 1000
 - 1 \leq c_i \leq 1000
 - 1 \leq t_i \leq 1000
 - The pairs (c_i, t_i) are distinct.

-----Input-----
Input is given from Standard Input in the following format:
N T
c_1 t_1
c_2 t_2
:
c_N t_N

-----Output-----
Print the smallest cost of a route that takes not longer than time T.
If there is no route that takes not longer than time T, print TLE instead.

-----Sample Input-----
3 70
7 60
1 80
4 50

-----Sample Output-----
4

 - The first route gets him home at cost 7.
 - The second route takes longer than time T = 70.
 - The third route gets him home at cost 4.
Thus, the cost 4 of the third route is the minimum.

Difficulty: introductory

Starter code:

Solutions:
n, t = map(int, input().split())
a = [list(map(int, input().split())) for i in range(n)]
l = []
flag = False
for i in range(n):
    if a[i][1] <= t:
        l.append(a[i][0])
        flag = True
if flag:
    print(min(l))
else:
    print('TLE')

N,T=map(int,input().split())
k=1000
l=1
for i in range(N):
    c,t=map(int,input().split())
    if t <= T:
        l=0
        if c < k:
            k = c
if l==1:
    print('TLE')
else:
    print(k)

n, T = map(int, input().split())
x = list()
cnt = 0
for i in range(n):
    c, t = map(int, input().split())
    if t <= T:
        x.append(c)
        cnt = 1
if cnt == 0:
    print("TLE")
else:
    print(min(x))

n,T=map(int,input().split())
ans=10000
for i in range(n):
  c,t=map(int,input().split())
  if t<=T:
    ans=min(ans,c)

if ans==10000:
  print("TLE")
else:
  print(ans)

a,b=input().split()
a=int(a)
b=int(b)
c=[input().split() for i in range(a)]
d=1001
for i in range(a):
  if int(c[i][1])<=b:
    if d>int(c[i][0]):
      d=int(c[i][0])
if d==1001:
  print("TLE")
else:
  print(d)


N, T = map(int, input().split())
ans = 1001
for i in range(N):
    c, t = map(int, input().split())
    if t <= T:
        ans = min(ans, c)

if ans <= 1000:
    print(ans)
else:
    print("TLE")

N, T = map(int, input().split())
c = [0 for i in range(N)]
t = [0 for i in range(N)]
for i in range(N):
  c[i], t[i] = map(int, input().split())

ans = float('inf')
flag = False
for i in range(N):
  if t[i] <= T:
    flag = True
    if ans > c[i]:
      ans = c[i]
if flag:
  print(ans)
else:
  print('TLE')

N,T=map(int,input().split())
cost=1000000
num=-1
for i in range(N):
  c,t=map(int,input().split())
  if t<=T and cost > c:
    cost = c
    num = i+1
print(cost if num > 0 else 'TLE')

n,t = map(int,input().split())
data = [input().split() for i in range(n)]
ans = 1001
for i in range(n):
    if int(data[i][1]) <= t:
        ans = min(ans,int(data[i][0]))
if ans == 1001:
    print('TLE')
else:
    print(ans)

n, T = map(int, input().split())
a = 1001
for _ in range(n):
    c, t = map(int, input().split())
    if t <= T and c < a:
        a = c
if a == 1001:
    print('TLE')
else:
    print(a)

N, T = map(int, input().split())
routes = [tuple(map(int, input().split())) for _ in range(N)]

res = 1001

for i in range(N):
    if routes[i][1] <= T:
        res = min(res, routes[i][0])

print([res, 'TLE'][res > 1000])


n,T = list(map(int,input().split()))
ans = 1001
for i in range(n):
    c,t = list(map(int,input().split()))
    if t <= T :
        ans = min(ans,c)
        
print((ans if ans!=1001 else "TLE"))  


N,T=map(int,input().split())
ans=2000
for i in range(N):
  c,t=map(int,input().split())
  if t<=T:
    ans=min(ans,c)
print(ans if ans!=2000 else "TLE")

n,T =list(map(int,input().split()))
ans = 10**3+1
for i in range(n):
    c,t=list(map(int,input().split()))
    if t > T:
        continue
    else:
        ans = min(ans,c)
if ans == 10**3+1:
    print('TLE')
else:
    print(ans)


# coding: utf-8

num, time = map(int, input().split())
count = 0
ans = 10000
for i in range(num):
    cost, tm = map(int, input().split())
    if tm <= time:
        if cost < ans:
            ans = cost
            max = ans
            count = 1
if count == 0:
    print("TLE")
else:
    print(ans)

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

c = []

for i in range(0,n):
    c_i, t_i = map(int, input().split())

    if t_i <= t:
        c.append(c_i)

if len(c) > 0:
    print(min(c))
else:
    print("TLE")

n,t=map(int, input().split())
c_list,t_list=[],[]
for i in range(n):
  x,y=map(int, input().split())
  c_list.append(x)
  t_list.append(y)
cost=1001
for i in range(n):
  if t_list[i]<=t and c_list[i]<cost:
    cost=c_list[i]
print(cost if cost<1001 else "TLE")

#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
#a = [list(input()) for _ in range(n)]
#a = [input() for _ in range(n)]

n,t = list(map(int, input().split()))
l = [list(map(int,input().split())) for i in range(n)]

costs = []
for i in range(n):
    if l[i][1] <= t:
        costs.append(l[i][0])

if len(costs) == 0:
    print("TLE")
else:
    print((min(costs)))



N,T = map(int,input().split())
ls = []
for i in range(N):
    c,t = map(int,input().split())
    if t <= T:
        ls.append(c)
if len(ls) == 0:
    print("TLE")
else:
    print(min(ls))

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

res = 10000

for i in range(n):
    a,b = map(int, input().split())
    if b <= t:
        res = min(res,a)

if res ==10000:
    print("TLE")
else:
    print(res)

N,T = map(int,input().split())
m = 1001
for i in range(N):
  c,t=map(int,input().split())
  if t<=T:
    m = min(m,c)
print("TLE" if m == 1001 else m)

N,T = map(int,input().split())
ls = []

for i in range(N):
  c,t = map(int,input().split())
  if t <= T:
    ls.append(c)
    
print(min(ls) if ls else "TLE")

n,t=map(int, input().split())
ans=10000
for i in range(n):
  a,b=map(int, input().split())
  if b<=t:
    ans=min(ans,a)
if ans<10000:
  print(ans)
else:
  print('TLE')

n,t = map(int,input().split())
ans = 1001
for i in range(n):
  c,time = map(int,input().split())
  if time <= t:
    ans = min(ans,c)
if ans == 1001:
  print("TLE")
else:
  print(ans)

# author:  Taichicchi
# created: 11.10.2020 10:52:46

import sys

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

ans = 100000
for i in range(N):
    c, t = list(map(int, input().split()))
    if t <= T:
        ans = min(ans, c)

if ans == 100000:
    print("TLE")
else:
    print(ans)


n,t=list(map(int,input().split()))
cost=1001
for i in range(n):
    ci,ti=list(map(int,input().split()))
    if ti<=t and ci<cost:
        cost=ci
if cost==1001:
    print('TLE')
else:
    print(cost)


N,T = map(int,input().split())
ans = 1001
ls = []
for i in range(N):
    ls.append(list(map(int,input().split())))
for i in ls:
    if i[1] <= T:
        ans = min(ans,i[0])
    else:
        continue
if ans == 1001:
    print('TLE')
else:
    print(ans)

N,T=map(int,input().split())
mi=1001
for i in range(N):
    c,t=map(int,input().split())
    if t<=T:
        if c<=mi:mi=c
if mi==1001:print("TLE")
else:print(mi)

N,T=list(map(int,input().split()))
ans=100000
for _ in range(N):
  c,t=list(map(int,input().split()))
  if t<=T:
    ans=min(ans,c)
print(('TLE' if ans==100000 else ans))


import math
from statistics import mean
# a=int(input())
#b=int(input())
# c=[]
# for i in b:
#     c.append(i)
e1,e2 = list(map(int,input().split()))
#f = list(map(int,input().split()))
#j = [input() for _ in range(3)]
h = []
for i in range(e1):
    h.append(list(map(int,input().split())))
r=[]
count=0
for i in range(e1):
    if h[i][1]<=e2:
         r.append(h[i][0])

if len(r)>0:
    print((min(r)))
else:
    print("TLE")




N,T = map(int, input().split())
l = []
for _ in range(N):
    c,t = map(int, input().split())
    if T >= t:
        l.append(c)
    else:
        l.append(1001)

print(min(l)) if min(l) < 1001 else print("TLE")

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

ct = [list(map(int, input().split())) for i in range(n)]

cost = []

for c, t in ct:
    if t <= T:
        cost.append(c)

if len(cost) == 0:
    print("TLE")
else:
    print(min(cost))

N,T=map(int,input().split())
l=[]
for i in range(N):
  c,t=map(int,input().split())
  if t<=T:
    l.append(c)
if len(l)==0:
  print("TLE")
else:
  print(min(l))

n,T = map(int,input().split())
ct = [list(map(int,input().split())) for _ in range(n)]
li = []
for k in ct:
    if k[1]<=T:
        li += [k[0]]
if li ==[]:
    print("TLE")
else:
    print(min(li))

N, T = map(int, input().split())
k=1001
for i in range(N):
    c,t=map(int, input().split())
    if t<=T and c<k: k=c
if k==1001:
    print("TLE")
    return
print(k)

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

ans = "TLE"
for i in range(N):
    c, t = map(int,input().split())
    if t <= T:
        if ans == "TLE" or ans > c:
            ans = c

print(ans)

n,t=map(int,input().split())
ct=[list(map(int,input().split())) for i in range(n)]
flag=0
ans=ct[0][0]
for i in range(n):
    if ct[i][1]<=t:
        flag=1
        ans=min(ans,ct[i][0])
    else:
        pass
if flag==0:
    print("TLE")
else:
    print(ans)

import sys
import math

#https://atcoder.jp/contests/agc008/submissions/15248942
sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))

N,T = inm()
min_cost = 2000

for i in range(N):
    c,t = inm()
    if t <= T:
        min_cost = min(min_cost,c)

if min_cost == 2000:
    print("TLE")
else:
    print(min_cost)


N, T = list(map(int, input().split()))
c = [0] * N
t = [0] * N
for i in range(N):
    c[i], t[i] = list(map(int, input().split()))

z = list(zip(c, t))
z = sorted(z)
c, t = list(zip(*z))

for i in range(N):
    if t[i] <= T:
        print((c[i]))
        return
print('TLE')


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

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

res = 10 ** 9
for _ in range(N):
    c, t = list(map(int, input().split()))
    if t <= T:
        res = min(res, c)

if res < 10 ** 9:
    print(res)
else:
    print("TLE")


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

n,t=map(int,input().split())
a=[list(map(int,input().split())) for i in range(n)]
c=[]
for i in range(n):
  if a[i][1]<=t:
    c.append(a[i][0])

if not c:
  print('TLE')
else:
  print(min(c))

N, T = map(int, input().split())
lst = []
for i in range(N):
    c, t = map(int, input().split())
    if t <= T:
        lst.append(c)
if not lst:
    print('TLE')
else:
    print(min(lst))

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

N,T=list(map(int,input().split()))
ans=float("inf")
for i in range(N):
   a,b=map(int,input().split())
   if T>=b:
      ans=min(ans,a)
print("TLE" if ans==float("inf") else ans)

N, T = map(int, input().split())
CT = [list(map(int, input().split())) for _ in range(N)]
cost = 9999
for i in range(N):
    if CT[i][1] <= T:
        if CT[i][0] < cost:
            cost = CT[i][0]
if cost == 9999:
    print("TLE")
else:
    print(cost)
pass

n, T = list(map(int, input().split()))
CT = [list(map(int, input().split())) for _ in range(n)]

ans = 1001
for c, t in CT:
    if t > T: continue
    ans = min(ans, c)
if ans == 1001:
  ans = "TLE"
print(ans)


import math
N,T=map(int, input().split())
ans = math.inf
for i in range(N):
    c,t=map(int,input().split())
    if t <= T:
        ans = min(ans, c)
print(ans if ans != math.inf else "TLE")

N,T=map(int,input().split())
cost=1001
for i in range(N):
    c,t=map(int,input().split())
    if T>=t:
        if cost>c:
            cost=c
print("TLE" if cost==1001 else cost)

N, T = list(map(int, input().split()))
ct = []
for i in range(N):
  tmp = list(map(int, input().split()))
  ct.append(tmp)
ct.sort()

ans = 0
for i in range(len(ct)):
  if ct[i][1] <= T:
    ans = ct[i][0]
    break
if ans == 0:
  print('TLE')
else:
  print(ans)


def mapt(fn, *args):
    return tuple(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))
  

def main():
    n, t = Input()
    data = [Input() for _ in range(n)]
    ans = 1001

    for cost, time in data:
        if time <= t:
            ans = min(ans, cost)

    if ans == 1001:
        print("TLE")
    else:
        print(ans)


main()

n,t = list(map(int,input().split()))
li = [list(map(int,input().split())) for i in range(n)]

lis = []
for i in li:
    if i[1] <= t:
       lis.append(i[0])
if len(lis) == 0:
    print('TLE')
else:
    print((min(lis)))


import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N, T = list(map(int, readline().split()))

    ans = INF
    for _ in range(N):
        c, t = list(map(int, readline().split()))
        if t <= T and ans > c:
            ans = c
    
    if ans < INF:
        print(ans)
    else:
        print('TLE')
    return


def __starting_point():
    main()

__starting_point()

N, T = map(int, input().split())
c = []
min_cost = 10000

for i in range(N):
    c, t = map(int, input().split())
    if t <= T and c < min_cost:
        min_cost = c
print(min_cost) if min_cost <= 1000 else print('TLE')

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

for _ in range(N):
    c,t = map(int, input().split())
    if t <= T:
        ans = min(ans,c)
if ans == 10000:
    print ('TLE')
else:
    print (ans)

N,T = map(int,input().split())
ans = 1001
for i in range(N):
    c,t = map(int,input().split())
    if t <= T:
        ans = min(ans,c)
        
print('TLE' if ans == 1001 else ans)

N, T = list(map(int, input().split()))
INF = 10**9
res = INF
for _ in range(N):
    c, t = list(map(int, input().split()))
    if t <= T and c < res:
        res = c
print((res if res != INF else 'TLE'))


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

import numpy as np

c = np.zeros(N)
t = np.zeros(N)

for i in range(N):
  c[i], t[i] = input().split()
  c[i] = int(c[i])
  t[i] = int(t[i])
  if t[i] > T :
    c[i] = 1001

if min(c) == 1001:
  print('TLE')
  
else:
  print((int(min(c))))


# ABC112

N, T = list(map(int, input().split()))
C_T = [list(map(int, input().split())) for _ in range(N)]
temp_c = 10**10
for c, t in C_T:
    if t <= T and c <= temp_c:
        temp_c = c


if temp_c == 10**10:
    ans = "TLE"
else:
    ans = temp_c
print(ans)


n,T=list(map(int ,input().split()))
l=[]
count=0
for i in range(0,n):
    c,t=list(map(int ,input().split()))
    if(t<T or t==T):
        l.append(c)
        
    else:
        count+=1
    
if(len(l)==0):
        print("TLE")
else:
    print((int(min(l))))


n,T=list(map(int,input().split()))
c=[0]*n
t=[0]*n
ans=[]
for i in range(n):
    c[i],t[i]=list(map(int,input().split()))
    if t[i]<=T:
        ans.append(c[i])
if len(ans)==0:
    print("TLE")
    return
print((min(ans)))


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

ans = 1001
for ct in CT:
    if ct[1] <= T:
        ans = min(ans, ct[0])

if ans == 1001:
    print('TLE')
else:
    print(ans)

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

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

ans = 1001
for p in ct:
    if p[1] <= T:
        ans = min(ans, p[0])

print(ans if ans != 1001 else "TLE")

n, t = map(int, input().split())
c = 10000
for i in range(n):
    tmp = input().split()
    if t >= int(tmp[1]):
        if int(tmp[0]) < c:
            c = int(tmp[0])
if c == 10000:
    print('TLE')
    return
else:
    print(c)

from typing import List


def answer(n: int, t: int, cts: List[List[int]]) -> int:
    costs = [route[0] for route in cts if route[1] <= t]
    if not costs:
        return -1

    return min(costs)


def main():
    n, t = list(map(int, input().split()))
    cts = [list(map(int, input().split())) for _ in range(n)]
    ans = answer(n, t, cts)
    print((ans if ans != -1 else 'TLE'))


def __starting_point():
    main()

__starting_point()

n,t = map(int,input().split())
ans = 10**9
l = []
for i in range(n):
  l.append(list(map(int,input().split())))
for i in range(n):
  if l[i][1] <= t:
    ans = min(l[i][0],ans)
if ans == 10**9:
  print("TLE")
else:
  print(ans)

N,T=map(int,input().split())
li=[list(map(int,input().split())) for i in range(N)]
li2=[]
for i in range(N):
  if li[i][1]<=T:
    li2.append(li[i])
li2.sort()
if len(li2)==0:
  print('TLE')
  return
print(li2[0][0])

n, t = [int(i) for i in input().split()]
list_route = [list(map(int, input().split())) for list_route in range(n)]
ans = 1001
for i in range(0, n):
    if list_route[i][1] <= t and ans >= list_route[i][0]:
        ans = list_route[i][0]
if ans != 1001: print(ans)
else: print("TLE")

n,t = map(int, input().split())
y = 10**5
c = [list(map(int,input().split())) for i in range(n)]
for i in range(n):
    if c[i][1]<=t:
        y=min(y,c[i][0])
if y != 10**5:
    print(y)
else:
    print("TLE")

N, T = map(int, input().split())
k = 1001
for i in range(N):
    c, t = map(int, input().split())
    if t <= T and c < k: k = c
if k == 1001:
    print("TLE")
    return
print(k)

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

cost = []

for i in range(N):
    c,t = map(int, input().split())
    if t <= T:
        cost.append(c) 

if len(cost) > 0:
    print(min(cost))
else:
    print("TLE")

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

for i in range(N):
    c,t=list(map(int, input().split()))
    if t<=T:
        c_list.append(c)

if c_list==[]:
    print("TLE")
    
else:
    print((min(c_list)))


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


n, t = map(int, input().split())
ans = 1001001001

for _ in range(n):
    ci, ti = map(int, input().split())
    if ti <= t:
        ans = min(ans, ci)

if ans == 1001001001:
    print('TLE')
else:
    print(ans)

N, T = map(int, input().split())
CT = [tuple(map(int, input().split())) for _ in range(N)]
res = 1001
for c, t in CT:
    if t <= T:
        res = min(res, c)
print(res if res <= 1000 else 'TLE')

n, T = map(int, input().split())
c = [0 for _ in range(n)]
t = [0 for _ in range(n)]
for i in range(n):
    c[i], t[i] = map(int, input().split())

ans = 1001

for i in range(n):
    if t[i] <= T:
        ans = min(ans, c[i])
print(ans if ans != 1001 else "TLE")

N, T = map(int, input().split())
c = [0 for i in range(N)]
t = [0 for i in range(N)]
for i in range(N):
  c[i], t[i] = map(int, input().split())

flag = False
ok = []
for i in range(N):
  if t[i] <= T:
    ok.append(t.index(t[i]))
    flag = True
ans = 1001
for i in ok:
  if ans > c[i]:
    ans = c[i]
if flag:
  print(ans)
else:
  print('TLE')

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

ans = 2000
for i in range(N):
    c,t = map(int, input().split())
    if t <= T:
        ans = min(c, ans)

print(ans if ans != 2000 else "TLE")



def main():
    N, T = map(int, input().split())
    l = []
    for _ in range(N):
        c, t = map(int, input().split())
        l.append((c, t))
    l.sort()
    for e in l:
        if e[1] <= T:
            print(e[0])
            return
    print("TLE")
        

def __starting_point():
    main()
__starting_point()

n,t = list(map(int,input().split()))
ans = 9999
for i in range(n):
    ci,ti = list(map(int,input().split()))
    if ti<=t:
        ans = min(ans,ci)
if ans == 9999:
    print('TLE')
else:
    print(ans)


N,T = list(map(int,input().split()))
ct=[9999]
for _ in range(N):
    ctt= list(map(int,input().split()))
    if ctt[1]<=T:
        ct.append(ctt[0])
if ct==[9999]:
    print("TLE")
    return
print((min(ct)))


n,t = map(int, input().split())
y = 10**5
for i in range(n):
    c,x = map(int,input().split())
    if x<=t:
        y=min(y,c)
if y != 10**5:
    print(y)
else:
    print("TLE")

ma = lambda :map(int,input().split())
lma = lambda :list(map(int,input().split()))
tma = lambda :tuple(map(int,input().split()))
ni = lambda:int(input())
yn = lambda fl:print("Yes") if fl else print("No")
import collections
import math
import itertools
import heapq as hq
import sys
n,T = ma()
ans=10**15
for i in range(n):
    c,t=ma()
    if t<=T:
        ans=min(ans,c)
if ans==10**15:
    print("TLE")
else:print(ans)


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

m = 1001

for i in range(N):
    
    c,t = list(map(int,input().split()))
    
    if t <= T:
        m=min(m,c)
        
print(("TLE" if m==1001 else m))



n,t = map(int,input().split())
l = [list(map(int,input().split())) for i in range(n)]
l = list(sorted(l,key=lambda x:x[1]))
c,m = [list(i) for i in zip(*l)]
ans = 9999
for i in range(n):
    if m[i] > t:
        break
    else:
        ans = min(ans,c[i])
if ans == 9999:
    print('TLE')
else:
    print(ans)

import sys

input = sys.stdin.readline


def main():
    N, T = [int(x) for x in input().split()]
    CT = [[int(x) for x in input().split()] for _ in range(N)]

    ans = float("inf")
    for c, t in CT:
        if t <= T:
            ans = min(ans, c)

    if ans == float("inf"):
        print("TLE")
    else:
        print(ans)


def __starting_point():
    main()

__starting_point()

N, T = map(int, input().split())
ans = 1001
for i in range(N):
  c, t = map(int, input().split())
  if t <= T:
    ans = min(ans, c)
print(ans) if ans < 1001 else print("TLE")


N,T = map (int, input ().split ())
C = 1001
for i in range (N):
  c,t = map (int, input ().split ())
  if t <= T and c < C:
    C = c
if C == 1001:
  print ('TLE')
else:
  print (C)

n,T=map(int,input().split())
ans=10000
for i in range(n):
  c,t=map(int,input().split())
  if t<=T:
    ans=min(ans,c)

if ans==10000:
  print("TLE")
else:
  print(ans)

n, t = map(int, input().split())
c_lists = []
t_lists = []
for i in range(n):
  c_i, t_i = map(int, input().split())
  c_lists.append(c_i)
  t_lists.append(t_i)

costs = []
for j in range(n):
    if t_lists[j] <= t:
        costs.append(c_lists[j])
if not costs:
    ans = 'TLE'
else:
    costs.sort()
    ans = costs[0]
print(ans)

n, t = list(map(int, input().split()))
mn = 1001
for i in range(n):
    c, tn = list(map(int, input().split()))
    if tn <= t and c < mn:
        mn = c
if mn == 1001:
    print("TLE")
else:
    print(mn)


N,T = map(int, input().split())
tl = []
for i in range(N):
    c,t = map(int, input().split())
    if t <= T:
        tl.append(c)
if len(tl) == 0:
    print('TLE')
else:
    print(min(tl))

#!/usr/bin/env python3

def main():
    n, time = list(map(int, input().split()))
    ans = 1001
    for i in range(n):
        c, t = list(map(int, input().split()))
        if t <= time:
            ans = min(ans, c)
    print((ans if ans != 1001 else 'TLE'))


def __starting_point():
    main()

__starting_point()

N,T=list(map(int,input().split()))
ans=10000
for _ in range(N):
    c,t=list(map(int,input().split()))
    if t<=T:
        ans=min(ans,c)
if ans==10000:
    print("TLE")
else:
    print(ans)


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

ans = 1001
N , T=list(map(int,input().split()))
for i in range(1,N + 1):
    c , t=list(map(int ,input().split()))
    if c <= ans and  t <= T:
        ans = c
if ans == 1001:
    print("TLE")
    return
print(ans)


N,T = list(map(int,input().split()))
cost = "TLE"
for i in range(N):
    c,t = list(map(int,input().split()))
    if t <= T:
        if cost == "TLE":
            cost = c
        else:
            if cost > c:
                cost = c

print(cost)


import operator

N, T = [int(i) for i in input().split()]
ct_list = [ [int(i) for i in input().split()] for j in range(N)]

tmp = list([x for x in ct_list if operator.ge(T,x[1])])

ans = min(tmp, key=lambda x: x[0])[0] if len(tmp) != 0 else "TLE"
print(ans)