Problem:
 Score : 200 points    Problem Statement 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 1 3 70
7 60
1 80
4 50      Sample Output 1 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.       Sample Input 2 4 3
1 1000
2 4
3 1000
4 500      Sample Output 2 TLE  There is no route that takes not longer than time T = 3 .       Sample Input 3 5 9
25 8
5 9
4 10
1000 1000
6 1      Sample Output 3 5

Solution (Python):
n, t = map(int, input().split())
cts = []
for _ in range(n):
    ct = list(map(int, input().split()))
    cts.append(ct)

min_cost = float("INF")
for ct in cts:
    temp_c = ct[0]
    temp_t = ct[1]
    if temp_t > t:
        continue
    if temp_c < min_cost:
        min_cost = temp_c

if min_cost == float("INF"):
    print("TLE")
else:
    print(min_cost)

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

Solution (Python):

N, T = [int(x) for x in input().split()]
cost = 9999
time = 9999
for i in range(N):
    c, t = [int(x) for x in input().split()]
    if t<=T and c<cost:
        cost = c
if cost==9999: cost = 'TLE'
print(cost)

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

Solution (Python):
N,T = map(int,input().split())
ctlist = [list(map(int,input().split())) for _ in range(N)]

minimum_cost = 1001

for sub_list in ctlist:
    if sub_list[1] <= T:
        if sub_list[0] < minimum_cost:
            minimum_cost = sub_list[0]

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

Solution (Python):
N, T = input().split()
N = int(N)
T = int(T)
NT = []

for i in range(N):
    ent = input().split()
    NT.append((i, int(ent[0]), int(ent[1])))

cost = 9999

for x in NT:
    if x[2] <= T:
        if x[1] < cost:
            cost = x[1]

if cost != 9999:
    print(cost)
else:
    print('TLE')

Solution (Python):
N, T = map(int,input().split())
c=[]
ans = 'TLE'

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

if len(c)>0:
    ans = min(c)
    
print(ans)

Solution (Python):
n,w = map(int,input().split())
m = 1001
for i in range(n):
    a,b = map(int,input().split())
    if b <= w and a < m:
        m = a
if m == 1001:
    print("TLE")
else:
    print(m)

Solution (Python):
n,w = map(int,input().split())
m = 1001
for i in range(n):
    a,b = map(int,input().split())
    if b <= w and a < m:
        m = a
if m == 1001:
    print("TLE")
else:
    print(m)

Solution (Python):
N, T = map(int, input().split(' '))
CT = [list(map(int, input().split(' '))) for _ in range(N)]
C_lt_T = [ct[0] for ct in CT if ct[1] <= T]

if len(C_lt_T) == 0:
    print('TLE')
else:
    print(min(C_lt_T))

Solution (Python):
N,T=(int(i) for i in input().split())
ctlist=[[int(i) for i in input().split()]for j in range(N)]
A=[ctlist[i] for i in range (N) if ctlist[i][1]<=T]
if A==[]:
  print('TLE')
else:
  B=[A[i][0] for i in range(len(A))]
  print(min(B))

Solution (Python):
N, T = map(int, input().split())

ans = 10 ** 10
for i in range(N):
    c, t = map(int, input().split())

    if t > T:
        continue

    ans = min(ans, c)

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

Solution (Python):
n, t = map(int, input().split(' '))
ans = inf = int(1e9)
for _ in range(n):
	c, t_ = map(int, input().split(' '))
	if t_ <= t:
		ans = min(ans, c)
if ans == inf:
	print("TLE")
else:
	print(ans)

Solution (Python):
def main(n:int, t:int, lst:list):
  lst = list(x for x in lst if x[1] <= t)
  if len(lst):
    return min(x[0] for x in lst)
  else:
    return "TLE"
n, t = map(int, input().split()) 
lst = [list(map(int, input().split())) for i in range(n)] 
print(main(n, t, lst))

Solution (Python):
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)

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

ansList = []
for i in range(N):
    if t[i] <= T:
        ansList.append(c[i])

if ansList == []:
    ans = "TLE"
else:
    ans = min(ansList)

print(ans)

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

Solution (Python):
n, limit = map(int, input().split())
c = [0] * n
t = [0] * n
for i in range(n):
    c[i], t[i] = map(int, input().split())
intime = []
for i in range(n):
    if t[i] <= limit:
        intime.append(i)
minn = 100000
for i in intime:
    if c[i] < minn:
        minn = c[i]
if intime == []:
    print('TLE')
else:
    print(minn)

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

Solution (Python):
N, T = map(int, input().split())
ct = [list(map(int, input().split())) for _ in range(N)]
ct.sort()
for i in ct:
    if i[1] <= T:
        print(i[0])
        exit()
else:
    print("TLE")

Solution (Python):
N, T = map(int, input().split())
ret = float('inf')
for _ in range(N):
    c, t = map(int, input().split())
    if t <= T and c < ret:
        ret = c

if ret == float('inf'):
    print("TLE")
else:
    print(ret)

Solution (Python):
N, T = [int(i) for i in input().split()]
S = [[int(i) for i in input().split()] for j in range(N)]
cost = 5000

for i in S:
    if i[1] > T:
        continue
    else:
        if i[0] < cost:
            cost = i[0]

if cost == 5000:
    print("TLE")
else:
    print(cost)

Solution (Python):
I=lambda:map(int,input().split())
N,T=I()
print((sorted(c for c,t in[I()for i in'N'*N]if t<=T)+['TLE'])[0])

Solution (Python):
def piyo():
    n , c = (int(i) for i in input().split())
    t = [[int(i) for i in input().split()] for i in range(n)]
    hogehoge = []
    for fizz in t:
        if fizz[1]<=c:
            hogehoge.append(fizz[0])
    if len(hogehoge)==0:
        print("TLE")
        return
    print(min(hogehoge))
    

if __name__ == '__main__':
    piyo()

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

Solution (Python):



def main():
    """Function."""
    n, t = map(int, input().split())

    min_val = 1001
    for _ in range(n):
        ci, ti = map(int, input().split())

        if ti <= t:
            if ci < min_val:
                min_val = ci
            else:
                pass
        else:
            pass

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


if __name__ == "__main__":
    main()

Solution (Python):
S = list(map(int,input().split()))
N = S[0]
T = S[1]
c = 0
for x in range(0,N):
    C = list(map(int,input().split()))
    if T < C[1]:
        continue
    else:
        if c == 0:
            c = C[0]
        if c > C[0]:
            c = C[0]
if c == 0:
    print('TLE')
else:
    print(c)

Solution (Python):
N, T = map(int, input().split())
c = [0 for _ in range(N)]
t = [0 for _ in range(N)]
ans = 1001

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

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

Solution (Python):
N, T = map(int, input().split())
c_t = [list(map(int, input().split())) for i in range(N)]
c_t = [[c, t] for c, t in c_t if t <= T]
C = sorted(c_t, key=lambda x:x[0])
print(C[0][0] if C else "TLE")

Solution (Python):
def main():
    n, t = map(int, input().split())
    pairs = sorted(tuple(map(int, input().split())) for _ in range(n))
    for p in pairs:
        if p[1] <= t:
            print(p[0])
            return
    print('TLE')


if __name__ == '__main__':
    main()

Solution (Python):
n, t = map(int, input().split())
cost = []
for i in range(n):
  x, y = map(int, input().split())
  if y <= t:
    cost.append(x)
if cost:
  print(min(cost))
else:
  print('TLE')

Solution (Python):
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))

Solution (Python):
if __name__ == '__main__':
    n = input().split(' ')
    roads = int(n[0])
    good_time = int(n[1])
    answer = -1
    for road in range(0, roads):
        n = input().split(' ')
        cost = int(n[0])
        time = int(n[1])
        if time > good_time:
            continue
        if answer < 0 or answer > cost:
             answer = cost
    if answer < 0:
        print('TLE')
    else:
        print(str(answer))

Solution (Python):
N,T = map(int, input().split())
ct = [list(map(int, input().split())) for i in range(N)]
ct_sort = sorted(ct, key=lambda x: x[1])

cost_limit_list = []

for i in ct_sort:
    if i[1]<=T:
        cost_limit_list.append(i)
    else:
        break
if len(cost_limit_list) == 0:
    print('TLE')
else:
    cost_limit_list = sorted(cost_limit_list, key=lambda x: x[0])
    print(cost_limit_list[0][0])

Solution (Python):
def main(n:int,t:int,lst:list):
    lst=list(filter(lambda x:x[1]<=t,lst))
    if len(lst):
        return min(map(lambda x:x[0],lst))
    else:
        return "TLE"
n,t=map(int,input().split())
lst=[list(map(int,input().split()))for i in range(n)]
print(main(n,t,lst))

Solution (Python):
a,b = map(int,input().split(" "))
ar = []
for i in range(a):
    l = list(map(int,input().split(" ")))
    if l[1] <= b:
        ar.append(l[0])
if len(ar) == 0:
    print("TLE")
else:
    print(min(ar))

Solution (Python):
N, T = map(int, input().split())
cost = 1000+1
T_ika_count = 0
for i in range(N):
    c, t = map(int, input().split())
    if t <= T:
        T_ika_count = T_ika_count+1
        if c < cost:
            cost = c
if T_ika_count == 0:
    print('TLE')
else:
    print(cost)

Solution (Python):
n,t = map(int,input().split())
A = [list(map(int,input().split())) for _ in range(n)]
ans = 1000000000
for i in range(n):
    if A[i][1] <= t:
        ans = min(ans,A[i][0])
if ans == 1000000000:
    print('TLE')
else:
    print(ans)

Solution (Python):
N, T = map(int, input().split())
c = []
t = []
for i in range(N):
    cn, tn = map(int, input().split())
    c.append(cn)
    t.append(tn)
count=0
for j in range(N):
    ans = min(c)
    if(t[c.index(ans)]>T):
        c[c.index(ans)] = 1001
        count+=1
    else:
        print(ans)
        break
if(count==len(c)):
    print('TLE')

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

Solution (Python):
n, T = map(int, input().split())
m = float('inf')
for _ in range(n):
    c, t = map(int, input().split())
    if t <= T:
        m = min(m, c)
if m == float('inf'):
    print('TLE')
else:
    print(m)

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

ct.sort()

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

print(ans)

Solution (Python):
N, T = map(int, input().split())

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

c_t_filtered = list(filter(lambda x:x[1] <= T ,c_t_list))
if len(c_t_filtered) > 0:
    print(min(c_t_filtered,key=lambda x:x[0])[0])
else:
    print("TLE")

Solution (Python):
import sys
lines = []
for line in sys.stdin:
  col = line.strip().split(' ')
  lines.append((int(col[0]), int(col[1])))
min = 1001
for cand in lines[1:]:
  if cand[1] <= lines[0][1] and cand[0] < min:
    min = cand[0]
print(min if min < 1001 else 'TLE')

Solution (Python):
import sys

def main(data):
    N, T = data[0].split(' ')
    routes = [(int(line.split(' ')[0]), int(line.split(' ')[1])) for line in data[1:int(N) + 1]]
    routes = list(filter(lambda x: x[1] <= int(T), routes))
    if len(routes) < 1:
        print('TLE')
    else:
        routes.sort(key=lambda x: x[0])
        print(routes[0][0])
    
if __name__ == '__main__':
    data = [line.strip() for line in sys.stdin]
    main(data)

Solution (Python):
N,T = map(int, input().strip().split())

cn = []
for i in range(N):
    tup = tuple(map(int, input().strip().split()))
    if tup[1] <= T:
        cn.append(tup)
if len(cn) == 0:
    print("TLE")
    exit()

sorted_cn =sorted(cn,key =  lambda c: c[0])
print(sorted_cn[0][0])

Solution (Python):
n, t0=input().split()
ans=1000
flag=False

for i in range(int(n)):
    c, t=input().split()
    if int(t) <= int(t0):
        flag=True
        if int(c)<ans:
            ans=int(c)
            
print(ans if flag else 'TLE')

Solution (Python):
num, time_lim = list(map(int, input().split()))
ans = 'TLE'
for i in range(num):
  cost, time_data = list(map(int, input().split()))
  if time_data > time_lim:
    continue
  if ans == 'TLE':
    ans = cost
  if ans > cost:
    ans = cost
print(ans)

Solution (Python):
N, T = map(int, input().split())

flag = False
min_c = 1000

for i in range(N):
    c, t = map(int, input().split())
    if min_c >= c and T >= t:
        min_c = c
        flag = True

if flag:
    print(min_c)
else:
    print("TLE")

Solution (Python):
n,t0=input().split()

ans=1000
flag=0

for i in range(int(n)):
  c,t=input().split()
  if int(t) <=int(t0):
    flag=1
    if int(c) < ans:
      ans=int(c)
      
print(ans if flag==1 else 'TLE')

Solution (Python):
N, T = list(map(int, input().split()))
minc = 1001;
for i in range(N):
  c, t = list(map(int, input().split()))
  if(t <= T and c < minc):
    minc = c
if(minc == 1001):
  print("TLE")
else:
  print(minc)

Solution (Python):
n, t = map(int, input().split())
costs=[]
time = []
for i in range(n):
    new_cost, new_time = map(int, input().split())
    if new_time<=t:
        costs.append(new_cost)
        time.append(new_time)
    else:
        continue
if costs ==[]:
    print('TLE')
else:
    print(min(costs))

Solution (Python):
N,T=map(int, input().strip().split(" "))

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

if cost==1001:
    cost='TLE'
    
print(cost)

Solution (Python):
def input_N_T():
    N_T=input().split()
    int_N_T=list(map(int,N_T))
    N=int_N_T[0]
    T=int_N_T[1]
    return [N,T]

N,T=input_N_T()

min_c,min_t=1001,1001

for i in range(N):
    c,t=input_N_T()
    if(t<=T and min(min_c,c)==c):
        min_c=c

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

Solution (Python):
n, t1 = map(int,input().split())
a = []
for _ in range(n):
    c, t2 = map(int,input().split())
    if  t2 <= t1:
        a.append(int(c))
print("TLE") if (len(a) == 0) else print(min(a))

Solution (Python):
N, T = (int(i) for i in input().split())
ct_matrix = [list(map(int,input().split())) for _ in range(N)]

c_min = 1001
for k in range(N):
    if ct_matrix[k][0] < c_min:
        if ct_matrix[k][1] > T:
            continue
        else:
            c_min = ct_matrix[k][0]

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

Solution (Python):
N, T = map(int, input().split())
ans = 1001
for i in range(N):
    c, t = map(int, input().split())
    if t > T:
        continue
    if ans > c:
        ans = c

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

Solution (Python):
N, T = map(int, input().split())
alist = []

for i in range(N):
    ct = list(map(int, input().split()))
    alist.append(ct)

blist = list(filter(lambda x: x[1] <= T, alist))

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

else:
    blist.sort(reverse=False)
    print(blist[0][0])

Solution (Python):
N, T = map(int, input().split())

X = [[int(a) for a in input().split()] for i in range(N)]

min = 1001

for i in range(N):
    hako = X[i]
    if hako[1] <= T and hako[0] <= min:
        min = hako[0]

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

Solution (Python):
import itertools
N, T = map(int, input().split())
CT = list(map(lambda _ :list(map(int, input().split())), range(N)))
if min(CT ,key = (lambda ct:ct[1]))[1] > T:
    print('TLE')
else:
    print(min(filter(lambda ct: ct[1]<=T, CT), key=(lambda ct: ct[0]))[0])

Solution (Python):
N, T = map(int, input().split())
fl = list(filter(lambda x: x[1] <= T, [[int(i) for i in input().split()] for _ in range(N)]))
print(min(fl, key=lambda x: x[0])[0] if len(fl) != 0 else "TLE")

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

Solution (Python):

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

clist = []
for i in range(N):
    tc, tt = list(map(int, input().split()))
    if T >= tt:
        clist.append(tc)
clist.sort()
try:
    print(clist[0])
except:
    print("TLE")

Solution (Python):
listA = list(map(int,input().split()))
listB = []
listC = []
for i in range(listA[0]):
    listB.append(list(map(int,input().split())))
[listC.append(i) for i in listB if i[1] <= listA[1]]
f = lambda a, b: a if a[0] < b[0] else b
c = [1001, 1001]

for i in listC:
    c = f(i, c)
d = c[0] if c[1] < 1001 else 'TLE'
print(d)

Solution (Python):
n,t=map(int,input().split())
mc=float('inf')
tle=True
for i in range(n):
    ci,ti=map(int,input().split())
    if ti<=t and ci<mc:
        mc=ci
        tle=False
if tle:
    print('TLE')
else:
    print(mc)

Solution (Python):
n, t = map(int, input().split())
ans = 10000
for i in range(n):
    c_i, t_i = map(int, input().split())
    if t_i <= t and c_i < ans:
        ans = c_i
if ans == 10000:
    print('TLE')
else:
    print(ans)

Solution (Python):
N,T = list(map(int,input().split(" ")))
ct = [list(map(int,input().split(" "))) for i in range(N)]
r = []
ct = sorted(ct,key=lambda x:x[1])
for i in ct:
    if T >= i[1]:
        r.append(i)
if r != []:
    r = sorted(r,key=lambda x:x[0])
    print(r[0][0])
else:
    print("TLE")

Solution (Python):
N, T = map(int,input().split())

C,t = [], []

for i in range(N):
    CT = list(map(int,input().split()))
    C.append(CT[0])
    t.append(CT[1])

C_min = 10000
for i,t_i in enumerate(t):
    if t_i <= T and C_min >= C[i]:
        C_min = C[i]
        
if C_min == 10000:
    print('TLE')
else:
    print(C_min)

Solution (Python):
n, tx = input().strip().split(' ')
n, tx = [int(n),int(tx)]

c_ans = 1001
for i in range (n):
    c, t = input().strip().split(' ')
    c, t = [int(c),int(t)]
    if c < c_ans and t <= tx:
        c_ans = c
if c_ans == 1001:
    print('TLE')
else:
    print(c_ans)

Solution (Python):
n,t = map(int,input().split())
INF = 99999999
ret = INF
for i in range(n):
    ci,ti = map(int,input().split())
    if ti <= t:
        ret = min(ret, ci)
if ret == INF:
    print("TLE")
else:
    print(ret)

Solution (Python):
N, T = map(int, input().split())

answer = 1001
c_list = [] 

for i in range(N):
	c_i, t_i = map(int, input().split())
	if T >= t_i:
		if answer > c_i:
			answer = c_i

if answer >= 1001:
	print('TLE')
else:
	print(answer)

Solution (Python):


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

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

    if t <= T and c < ans:
        ans = c

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

Solution (Python):
N, T = map(int,input().split())
cost=float('inf')
for i in range(N):
  c,t=map(int,input().split())
  if T>=t:
    cost = min(cost,c)
  if i==N-1 and cost==float('inf'):
    cost='TLE'
print(cost)

Solution (Python):
n,t=list(map(int,input().split()))
lis = []
for i in range(n):
  s,k = list(map(int,input().split()))
  if k <= t:
    lis.append(s)
if lis == []:
  print("TLE")
  quit()
print(min(lis))

Solution (Python):
N, T = map(int, input().split())
ans = float('inf')
for i in range(N):
  c, t = map(int, input().split())
  if t <= T:
    ans = min(ans, c)

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

Solution (Python):
n, t = map(int, input().split())

info_list = []
min = 10000
for i in range(n):
    ci, ti = map(int, input().split())
    if ti <= t and ci < min:
        min = ci

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

Solution (Python):
N, T = map(int, input().split(" "))
ans = (10000,-1)
for i in range(0,N):
    c, t = map(int, input().split(" "))
    if t <= T and ans[0] > c:
        ans = (c,t)

print(ans[0] if not ans[1] == -1 else "TLE")

Solution (Python):
import numpy as np

N, T = map(int, input().split())
cmin = 1000
index = -1
c = np.arange(N)
t = np.arange(N)

for i in range(N):
    c[i], t[i] = input().split()
    if t[i] <= T:
        if c[i] <= cmin:
            cmin = c[i]
            index = i
if index == -1:
    print("TLE")
else:
    print(c[index])

Solution (Python):
N, T = map(int, input().split())

cost = []
time = 0
for i in range(N):
    c, t = map(int, input().split())
    if t <= T:
        cost.append(c)
        time += 1

if time != 0:
    print(min(cost))
else:
    print('TLE')

Solution (Python):
n, t = map(int, input().split())

message = "TLE"

for i in range(n):
    cost, time = map(int, input().split())
    if time <= t and (message == "TLE" or cost < int(message)):
        message = str(cost)

print(message)

Solution (Python):
n, t = map(int, input().split())

min_cost = 1001

for i in range(n):
    cost, time = map(int, input().split())
    if time <= t and cost < min_cost:
        min_cost = cost

if min_cost < 1001:
    print(min_cost)
else:
    print("TLE")

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

s_path=float('inf')

for i in paths:
  if i[1]<=T:
    s_path=min(s_path,i[0])

if s_path == float('inf'):
  print('TLE')
else:
  print(s_path)

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

smallest_cost = 2000
for i in range(N):
    if t[i] > T:
        continue
    if c[i] > smallest_cost:
        continue
    smallest_cost = c[i]

if smallest_cost == 2000:
    smallest_cost = 'TLE'

print(smallest_cost)

Solution (Python):
N,T=map(int,input().split())
c_list=[]
cnt=0
for i in range(N):
    c,t=map(int,input().split())
    if t <= T:
        c_list.append(c)
        cnt+=1
if cnt == 0:
    print('TLE')
else:
    print(min(c_list))

Solution (Python):
def takeFirst(elem):
    return elem[0]

N, T = map(int, input().split())
cts = []
for n in range(N):
	c, t = map(int, input().split())
	cts.append((c,t))

cts.sort(key=takeFirst)


for ct in cts:
	if ct[1] <= T: 
		print(ct[0])
		exit()

print('TLE')

Solution (Python):
n,t = map(int,input().split())

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

if len(a) > 0 :
    a.sort(key=lambda x : x[0])
    print(a[0][0])
else :
    print("TLE")

Solution (Python):
n,t = map(int,input().split())

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

if len(a) > 0 :
    a.sort(key=lambda x : x[0])
    print(a[0][0])
else :
    print("TLE")

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

c_min = 10000

for c_i, t_i in zip(c,t):
   if t_i <= T and c_i <= c_min:
       c_min = c_i

if c_min == 10000:
    print('TLE')

else:
    print(c_min)

Solution (Python):
n,t=map(int,input().split())
l=[list(map(int,input().split())) for i in range(n)]
l.sort(key=lambda x:x[0])
a='TLE'
for i in l:
    if i[1]<=t:
        a=str(i[0])
        break
print(a)

Solution (Python):



def main():
    n, t = map(int, input().split())
    tmp_t = float('inf')
    ans = float('inf')

    for i in range(n):
        ci, ti = map(int, input().split())

        if ti <= t and ci < ans:
            tmp_t = ti
            ans = ci

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


if __name__ == '__main__':
    main()

Solution (Python):
N, T = map(int, input().split())
L = [list(map(int, input().split())) for k in range(N)]
ans = 10000
for l in L:
    if l[1] <= T:
        ans = min(ans,l[0])
print(ans if ans != 10000 else "TLE")

Solution (Python):
import sys
stdin = sys.stdin

sys.setrecursionlimit(10**5)

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

n,t = li()
ct = []
for _ in range(n):
    ct.append(list(li()))
    
ans = 10**18
for ci, ti in ct:
    if ti <= t:
        ans = min(ans, ci)
        
if ans == 10**18:
    print("TLE")
else:
    print(ans)

Solution (Python):
N, T = map(int, input().split())

INF = float('inf')
cost = INF
for i in range(N):
    c, t = map(int, input().split())
    if t <= T:
        cost = min(cost, c)

if cost == INF:
    print('TLE')
else:
    print(cost)

Solution (Python):
N,T = 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')

Solution (Python):
n,t=input().split()
n=int(n)
x=[[int(i) for i in input().split()] for j in range(n)] 


cost=1000000000
for i in range(n):
  if x[i][1]<=int(t):
    if x[i][0]<cost:
      cost=x[i][0]
if cost==1000000000:
  print('TLE')
else:
  print(cost)

Solution (Python):
def abc112_b():
    n, t_lim = map(int,input().split())
    c = []
    for _ in range(n):
        ci, t = map(int, input().split())
        if t <= t_lim:
            c.append(ci)
    if c == []:
        return "TLE"
    else:
        return min(c)


print(abc112_b())

Solution (Python):
n,t = map(int,raw_input().split())
arr = []
for i in range(n):
    a,b = map(int,raw_input().split())
    arr.append((a,b))
cs = 10**20
for i in range(n):
    if arr[i][1] <= t:
        cs = min(cs,arr[i][0])
ans = cs if cs != 10**20 else "TLE"
print ans

Solution (Python):
a,b=map(int,input().split())
c = [[int(i) for i in input().split()] for i in range(a)]

hantei=False
d=[]
for i in range(a):
    if b>=c[i][1]:
        d.append(c[i])
        hantei=True
    else:
        continue
if hantei==False:
    print("TLE")
else:
    print(sorted(d)[0][0])

Solution (Python):

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

cost = 1001
for i in range(n):
    c,ti = list(map(int, input().split(' ')))
    if ti <= t:
        cost = min(cost, c)

if cost > 1000:
    print('TLE')
else:
    print(cost)

Solution (Python):
N,T = map(int, input().split())
c = [0]*N
t = [0]*N
cost = 1001
for i in range(N):
    c[i], t[i] = map(int,input().split())
    if t[i]<=T:
        cost  = min(cost,c[i])
if cost == 1001:
    print("TLE")
else:
    print(cost)

Solution (Python):

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

ans = 1001

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

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

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

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

Solution (Python):
NT = list(map(int, input().split()))
mini = -1
for i in range(NT[0]):
    route = list(map(int, input().split()))
    if route[1] <= NT[1]:
        if mini == -1:
            mini = route[0]
        elif mini > route[0]:
            mini = route[0]
if mini == -1:
    print('TLE')
else:
    print(mini)

Solution (Python):
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)

Solution (Python):
N, T = map(int, input().split())
C = []
ts = []
for i in range(N):
    c, t = map(int, input().split())
    C.append(c)
    ts.append(t)

ans = 1e100
for i in range(N):
    if ts[i] <= T:
        ans = min(ans, C[i])
if ans == 1e100:
    print("TLE")
else:
    print(ans)

Solution (Python):
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)

Solution (Python):
def main():
    n, T = map(int, input().strip().split())

    min_c = 10000
    for i in range(n):
        c, t = map(int, input().strip().split())
        if t > T:
            continue;
        if c < min_c:
            min_c = c

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

if __name__ == "__main__":
    main()

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

print(min_cost if min_cost <= 1000 else "TLE")

Solution (Python):
n, t = map(int, input().split())
minCost = 1001
for i in range(n):
    cc, tt = map(int, input().split())
    if tt <= t and cc < minCost:
        minCost = cc
if minCost == 1001:
    print('TLE')
else:
    print(minCost)

Solution (Python):
n, T = map(int, input().split())
c, t = [], []

for i in range(n):
    a, b = map(int, input().split())
    c.append(a)
    t.append(b)










costs = []
min_time  = T
for i in range(n):
    if t[i] <= T:
        costs.append(c[i])

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

Solution (Python):
N, T = map(int, input().split())
C = {c: t for c, t in (map(int, input().split()) for _ in range(N))}
cl = [k for k, v in C.items() if v <= T]

if cl == []:
    print('TLE')
else:
    print(min(cl))

Solution (Python):
N,T = map(int,input().split())
l = [[int(i) for i in input().split()] for _ in range(N)]
l.sort(key=lambda x:x[0])
OK,ans = False,0
for i in range(N):
    if l[i][1]<=T:
        ans = i
        OK = True
        break
print(l[ans][0] if OK else 'TLE')

Solution (Python):
def solve():
    cost = 1001
    N, time = map(int, input().split())
    for _ in range(N):
        c, t = map(int, input().split())
        if t <= time and c <= cost:
            cost = c
    print('TLE' if cost is 1001 else cost)


if __name__ == '__main__':
    solve()