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

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

Solution (Python):
N,T=map(int,input().split())
cmin = None
for i in range(N):
    c,t=map(int,input().split())
    if t > T :
        pass
    else :
        if not cmin :
            cmin = c
        elif c < cmin :
            cmin = c
    

if not cmin :
    print("TLE")
else:
    print(cmin)

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

ct = []
for i in range(N):
    x = list(map(int, input().split()))
    ct.append(x)
    
min_cost = 10000
for i in range(N):
    if ct[i][0] < min_cost and ct[i][1] <= T:
        min_cost = ct[i][0]
        
if min_cost == 10000:
    print("TLE")
else:
    print(min_cost)

Solution (Python):


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

for _ in range(N):
    c, t = list(map(int, input().split()))
    ct_list.append((c, t))

min_c = float("inf")

for ct in ct_list:
    c, t = ct
    if t <= T:
        min_c = min(c, min_c)

ans = min_c if min_c != float("inf") else "TLE"
print(ans)

Solution (Python):
import sys
N,T = map(int,input().split())
c = []
t = []
cmin = 1000
for i in range(N):
    c1,t1=[int(i) for i in input().split()]
    c.append(c1)
    t.append(t1)
if min(t) > T:
  print("TLE")
  sys.exit()    
for i in range (0,N):
  if t[i] <= T:
    cmin = min(c[i],cmin)
print(cmin)

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

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



Array.sort(key=lambda x:x[0])








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

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

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):
import sys



def gg():
	a,b=map(int, input().split())
	return (a,b)


def main():
	n,t = map(int, input().split())
	al=[gg() for _ in range(n)]
	cc = [x[0] for x in al if x[1] <= t]
	if len(cc)==0:
		ans='TLE'
	else:
		ans=min(cc)
	print(ans)
	return
	
	

isTest=False

def pa(v):
	if isTest:
		print(v)

if __name__ == "__main__":
	if sys.platform =='ios':
		sys.stdin=open('inputFile.txt')
		isTest=True
	else:
		pass
		
			
	ret = main()
	if ret is not None:
		print(ret)

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

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)
    else:
        ans = ans
if ans == 10000:
    print("TLE")
else:
    print(ans)

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 = [int(s) for s in input().split(' ')]
cost = 9999
for i in range(0, N):
    c, t = [int(s) for s in input().split(' ')]
    if t > T:
        continue
    cost = min(c, cost)
    
print(cost if cost < 9999 else 'TLE')

Solution (Python):
n, T = map(int, input().split())
try:
    c = min(c for c, t in [map(int, input().split()) for _ in range(n)] if t <= T)
    print(c)
except:
    print("TLE")

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

Solution (Python):
import os, sys, re, math

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

min_cost = sys.maxsize
for i in range(N):
    (c, t) = [int(j) for j in input().split()]
    if t <= T and c < min_cost:
        min_cost = c

print (min_cost if min_cost < sys.maxsize else 'TLE')

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

Solution (Python):
n,T=map(int,input().split())
ansc=1000
k=0
for _ in range(n):
    c,t=map(int,input().split())
    if T>=t:
        ansc=min(c,ansc)
    else:
        k+=1
if not n==k:
    print(ansc)
else:
    print('TLE')

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):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from bisect import bisect

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N, T = MAP()
ct = [LIST() for _ in range(N)]

ans = 10000
for c, t in ct:
	if t <= T:
		ans = min(ans, c)
if ans == 10000:
	print("TLE")
else:
	print(ans)

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

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

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

Solution (Python):
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 == 1001:
  print("TLE")
else:
  print(ans)

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

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

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

Solution (Python):
N, T = map(int, input().split())
ans = 10**5
for i in range(N):
  c, t = map(int, input().split())
  if t <= T:
    ans = min(ans, c)
if ans == 10**5:
  ans = 'TLE'
print(ans)

Solution (Python):
n, t = map(int, input().split())
ans = []
for _ in range(n):
    c, ct = map(int, input().split())
    if ct <= t:
        ans.append(c)
        
if ans == []:
    print('TLE')
else:
    print(min(ans))

Solution (Python):
n,T=map(int,input().split())
c_l=[]
t_l=[]
for i in range(n):
	c,t=map(int,input().split())
	if t>T:
		c=1001
	c_l.append(c)
	t_l.append(t)
print("TLE" if min(c_l) == 1001 else min(c_l))

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

for i in range(n):
  ci, ti = map(int, input().split())
  if ti <= t:
      c_list.append(ci)
      
if c_list == []:
    print('TLE')
else:
    print(min(c_list))

Solution (Python):
n,t=map(int,input().split())
ct=[list(map(int,input().split())) for i in range(n)]
l=[]
count=0
for i in range(n):
    if ct[i][1]<=t:
        l+=[ct[i][0]]
        count+=1
print(min(l) if count>0 else 'TLE')

Solution (Python):
n,t=map(int,input().split())
l=[list(map(int,input().split())) for i in range(n)]
l=[[j for j in i] for i in l if i[1]<=t]
s=0
for i in l:
  s+=i[1]
if s!=0:
  print(min(l)[0])
else:
  print('TLE')

Solution (Python):
from operator import itemgetter

N, T = map(int, input().split())
c = []
t = []
IDX = []

for idx in range(N):
    tmp, tmp2 = map(int, input().split())
    c.append(tmp)
    t.append(tmp2)
    IDX.append(idx+1)

ctIDX = [list(x) for x in zip(c,t,IDX) if x[1] <= T]
ctIDX = sorted(ctIDX, key=itemgetter(0))

try:
    print(ctIDX[0][0])
except:
    print("TLE")

Solution (Python):
def main():
    N,T = map(int, input().split())
    min_c = 1001
    find_flg = False
    for i in range(N):
        cn,tn = map(int, input().split())
        if(tn<=T and cn < min_c):
            find_flg = True
            min_c = cn
    if(find_flg):
        print(min_c)
    else:
        print('TLE')

if __name__ == "__main__":
    main()

Solution (Python):
N,T = [int(i) for i in input().split()]
ans=10000
for i in range(N):
    c,t = [int(i) for i in input().split()]
    if t<=T and c<ans: ans=c
print("TLE" if ans==10000 else ans)

Solution (Python):
n,t = map(int,input().split())
ct = [list(map(int,input().split())) for _ in range(n)]
ct.sort(key = lambda x:x[1])
ans = 10**9
for path in ct:
  if path[1] > t:
    break
  else:
    ans = min(ans ,path[0])
print(ans if ans != 10**9 else "TLE")

Solution (Python):
N,T=map(int,input().split())
found=False
for _ in range(N):
    c,t=map(int,input().split())
    if t <= T:
        if not found:
            ans=c
            found=True
        else:
            ans=min(ans,c)
print(ans if found else "TLE")

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

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

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

Solution (Python):
N,T=map(int,input().split())
ct=[tuple(map(int,input().split())) for i in range(N)]
ans=10**9
for c,t in ct:
    if T<t:
        continue
    else:
        ans=min(ans,c)
print(ans if ans!=10**9 else 'TLE')

Solution (Python):
a, b = map(int, input().split())
C = []
for _ in range(a):
  c, t = map(int, input().split())
  if t <= b:
    C.append(c)
if not C ==[]:
  print(min(C))
else:
  print("TLE")

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

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

keep_cost = 1001

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


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

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

keep_cost = 1001
taken_t = 1001
for i in range(n):
    c,t = map(int, input().split())
    if T >= t:
        if c <= keep_cost:
            keep_cost = c
            taken_t = t

print(keep_cost if taken_t <= T else "TLE")

Solution (Python):
import sys
from bisect import *
from collections import *
from copy import deepcopy
from datetime import *
from heapq import *
from itertools import *

from operator import *
from pprint import *

sys.setrecursionlimit(10**8)

input = sys.stdin.readline

def main():
    """ main """
    N,T = map(int, input().split())
    ans = float('inf')
    for _ in range(N):
        c,t = map(int, input().split())
        if t > T: continue
        ans = min(ans, c)

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

if __name__ == '__main__':
    main()

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


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

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

 
if __name__ == '__main__':
    main()

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

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

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

C=1001
for i in range(N):
    if CT[i][1] <= T:
        C=min(C,CT[i][0])

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

Solution (Python):
n, t = map(int, input().split())
c = [input().split() for _ in range(n)]
c_sorted = sorted(c, key=lambda i:int(i[0]))
for i in range(n):
    if int(c_sorted[i][1]) <= t:
        print(c_sorted[i][0])
        exit()
    else:
        pass
print('TLE')

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

result = []
for i in range(n):
    if ans[i][1] <=T:
        result.append(ans[i][0])
    else:
        result.append(1000000)
if min(result) == 1000000:
    print('TLE')
else:
    print(min(result))

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


A =[1001]
for i in C:
    if i[1] <= T:
        A.append(i[0])

print(min(A) if min(A) != 1001 else "TLE")

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

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

Solution (Python):

std_input = open(0).readlines()
N, T = map(int, std_input[0].split())
s_t = [list(map(int, i.rstrip("\n").split())) for i in std_input[1:1+N]]

cnt = 0
s_t_T = []
for i in s_t:
    if i[1] > T:
        cnt += 1
    else:
        s_t_T.append(i[0])

if cnt == N:
    print("TLE")
else:
    print(min(s_t_T))

Solution (Python):
import sys

input = sys.stdin.readline


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


if __name__ == "__main__":
    main()

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):
def slove():
    import sys
    input = sys.stdin.readline
    n, t = list(map(int, input().rstrip('\n').split()))
    mt = 10 ** 9
    for i in range(n):
        c1, c2 = list(map(int, input().rstrip('\n').split()))
        if c2 <=t:
            mt = min(mt, c1)
    if mt == 10 ** 9:
        print("TLE")
    else:
        print(mt)


if __name__ == '__main__':
    slove()

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

Solution (Python):
n,t = list(map(int, input().split()))
a = [list(map(int, input().split())) for _ in range(n)]
a.sort()
ans = "TLE"
for b,c in a:
    if c <= t:
        ans  = b
        break
print(ans)

Solution (Python):
MAX_INT = 10000000
N, T = map(int, input().split())
cl, tl = [], []

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

c_min = MAX_INT
for i in range(N):
    if tl[i] <= T:
        c_min = min(c_min, cl[i])

if c_min < MAX_INT:
    print(c_min)
else:
    print('TLE')

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:
        if c[i] < cost:
            cost = c[i]
if cost == 1001:
    print('TLE')
else:
    print(cost)

Solution (Python):


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

minCos = 1000
bestRoot = -1
for i in range(n):
    inpt = map(int, raw_input().split())
    if inpt[1] > t:
        continue

    if inpt[0] <= minCos:
        minCos = inpt[0]
        bestRoot = i + 1

if bestRoot == -1:
    print "TLE"
else:
    print minCos

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

Solution (Python):


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

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




INF = 10**4
dp = INF
for i in range(n):
    if T >= t[i]:
        dp = min(dp, c[i])

if dp == INF:
    print("TLE")
else:
    print(dp)

Solution (Python):



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


ans = 1001
for i in range(N):
    if t[i] <= T:
        ans = min(ans, c[i])


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

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

l =sorted([[int(i) for i in input().split()] for _ in range(a)],key = lambda x : x[0])

flg = True
for i in l:
    if i[1] <= b:
        print(i[0])
        flg = False
        break
    else:
        pass
    
if flg == True:
    print('TLE')

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

ck =0
for i in range(n):
    if ct[i][1]<=t:
        ck =1
        break
if ck ==1:
    print(ct[i][0])
    exit()
print('TLE')

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

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

fil_tr = list(filter(lambda x: x[1] <= t, tr))
if not fil_tr:
    print("TLE")
    exit()

sorted_tr = min(fil_tr, key=lambda x: x[0])
print(sorted_tr[0])

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

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)
    
C=[]
for i in range(N):
    if t[i]<=T:
        C.append(c[i])

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

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

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

if min_cost < 10000:
    print(min_cost)
else:
    print('TLE')

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

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

path_before_t = list(filter(lambda x: x[1] <= t, path))
if len(path_before_t) == 0:
    print('TLE')
else:
    print(min(path_before_t)[0])

Solution (Python):
import numpy as np
N, T=map(int, input().split())
temp=np.array([list(map(int, input().split())) for i in range(N)])
temp=temp[temp[:, 1]<=T]
if temp.shape[0]==0:
  print('TLE')
else:
  print(np.min(temp[:, 0]))

Solution (Python):
n,t= map(int,input().split())
ct = sorted([list(map(int, input().split())) for _ in range(n)])
m=1001
for i in range(n):
    if(ct[i][1]<=t):
        m=min(m,ct[i][0])
if(m==1001):
    print("TLE")
else:
    print(m)

Solution (Python):
n, time = [int(_) for _ in input().split()]
tmp = 1001
output = 0

for i in range(n):
    c, t = [int(_) for _ in input().split()]
    if c < tmp and t <= time:
        tmp = c
        output = c

if output == 0:
    print("TLE")

else:
    print(output)

Solution (Python):
N,T = map(int,input().split())
cmin = 10**4
for _ in range(N):
    c,t = map(int,input().split())
    if t<=T:
        cmin = min(cmin,c)
if cmin>10**3:
    print("TLE")
else:
    print(cmin)

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())
min_c = 1001
for i in range(N):
    c, t = map(int, input().split())
    if t <= T:
        min_c = min(c,min_c)
print(min_c if min_c != 1001 else 'TLE')

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

min_c = 1001

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

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

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

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

Solution (Python):
n, t = map(int, input().split())
case = []
for i in range(n):
  c = list(map(int, input().split()))
  case.append(c)
mini = 1e9
for i in range(n):
  if(t>= case[i][1]):
    if(mini>case[i][0]):
      mini = case[i][0]
if(mini == 1e9):
  print("TLE")
else:
  print(mini)

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

Solution (Python):
N,T=map(int,input().split())
List=[list(map(int,input().split())) for i in range(N)]
LList=[]
for j in range(N):
  if List[j][1]<=T:
    LList.append(List[j][0])
print("TLE") if LList==[] else print(min(LList))

Solution (Python):
import sys


N, T = map(int, input().split())
CT = [list(map(int, input().split())) for _ in range(N)]
target_list = [[c, t] for c, t in CT if t <= T]

if len(target_list) == 0:
    print('TLE')
else:
    target_list = sorted(target_list, key=lambda t: t[0])
    print(target_list[0][0])

Solution (Python):
N, T = map(int, input().split())
ct = list(filter(lambda x: x[1] <= T, [list(map(int, input().split())) for _ in range(N)]))
ct = sorted(ct, key=lambda x: x[0])
if not ct:
    print('TLE')
else:
    print(ct[0][0])

Solution (Python):
s=list(input().split())
n=int(s[0])
l=int(s[1])
cost=[]
time=[]

for i in range(n):
  li=list(input().split())
  if int(li[1])<=l:
    cost.append(int(li[0]))
    time.append(int(li[1]))
if len(cost)==0:
  print('TLE')
else:
  print(min(cost))

Solution (Python):
N, T = map(int, input().split())
mc = 1e4
for _ in range(N):
    c, t = map(int, input().split())
    if t <= T and c < mc:
        mc = c

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

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

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())
A=[]
for i in range(n):
  a=list(map(int, input().split()))
  if a[1] <= t:
    A.append(a[0])
if len(A)==0:
  print('TLE')
else:
  print(min(A))

Solution (Python):

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

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

ans = 9999

for i in c:
    if (i[1] <= t):
        ans = min(ans, i[0])
print(ans if ans != 9999 else 'TLE')

Solution (Python):
import sys
n, t = map(int,input().split())
src = [list(map(int,input().split())) for _ in range(n)]
new = []
for s in src:
    if s[1] <= t:
        new.append(s[0])
if len(new) == 0:
    print('TLE')
    sys.exit()
print(min(new))

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

Solution (Python):
n,t=map(int, input().split())
Routes=[list(map(int, input().split())) for _ in range(n)]
r=list(filter(lambda x:x[1] <= t, Routes))
if not r:
    ans="TLE"
else:
    ans=sorted(r)[0][0]

print(ans)

Solution (Python):
N,T = [int(x) for x in input().split()]
ans =100000000
for i in range(N):
  c,t =[int(x) for x in input().split()]
  if t<=T:
    ans = min(c,ans)
if ans!=100000000:
  print(ans)
else:
  print("TLE")

Solution (Python):
n,t1 = map(int,input().split())
ls = []
ans = 1001
for i in range(n):
    c,t2 = map(int,input().split())
    if t1 >= t2:
        ans = min(c,ans)
    
if ans != 1001:
    print(ans)
else:
    print("TLE")

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

best_c = 1001
best_t = t

for _ in range(n):
  c_i, t_i = map(int, input().split())
  if (t_i <= t) & (c_i < best_c):
    best_c = c_i
    
print(best_c if best_c != 1001 else 'TLE')

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

Solution (Python):

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

Solution (Python):
n, T = map(int, input().split())
cMin = 10000
for i in range(n):
    c, t = map(int, input().split())
    if cMin > c and T >= t:
        cMin = c
print(cMin if cMin != 10000 else "TLE")

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())
ind_list = []
for i in t:
    if i <= T:
        ind_list.append(t.index(i))
if len(ind_list) == 0:
    print('TLE')
else:
    print(min(c[i] for i in ind_list))

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

ans=10100
flag=False
for d,e in zip(clist,tlist):
  if e<=T:
    ans=min(ans,d)
    flag=True
if flag == False:
  print("TLE")
else:
  print(ans)

Solution (Python):
[n,t]=list(map(int,input().split()))
ntlist=[list(map(int,input().split())) for _ in range(n)]
 
anslist=[nt[0] for nt in ntlist if nt[1]<=t]
if anslist==[]:
  print("TLE")
else:
  print(min(anslist))

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

Solution (Python):

def main():
    N, T, *CT = map(int, open(0).read().split())
    cand = {c for c, t in zip(*[iter(CT)] * 2) if t <= T}
    flg = cand
    print(min(cand) if flg else "TLE")


if __name__ == "__main__":
    main()

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

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])
print(cost if cost != 1001 else 'TLE')

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

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

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

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

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

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

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

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

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

Solution (Python):
N,T = list(map(int,input().split()))
c0 = 1000
count = 0
for i in range(N):
  c,t = list(map(int,input().split()))
  if t <= T:
    if c < c0:
      c0 = c
    else:
      continue
  else:
    count += 1
    continue

if count == N:
  print("TLE")
else:
  print(c0)

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

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

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

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

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(c, m)
if m == 1001:
  print("TLE")
else:
  print(m)

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

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

if ans == 1001:
    ans = "TLE"

print(ans)

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):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
N,T= map(int,input().split())

c=[]
t=[]
m=10000
cnt=0
C=[list(map(int,input().split())) for _ in range(N)]

for j in range(N):
	if C[j][1]>T:
		cnt+=1
	else:
		m=min(C[j][0],m)
		

	

if cnt==N:
	print("TLE")
else:
	print(m)

Solution (Python):
n, T = map(int, input().split())
cand = []
for i in range(n):
    c, t = map(int, input().split())
    if t <= T:
        cand.append(c)

if len(cand) > 0:
    cand.sort()
    print(cand[0])
else:
    print('TLE')