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())
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())
coti = [input().split() for i in range(N)]

mincost = 1001
for pair in coti:
    
    if int(pair[1]) <= T:
        if int(pair[0]) < mincost:
            mincost = int(pair[0])
        continue
if mincost == 1001:
    print('TLE')
else:
    print(mincost)

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

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

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)

C.sort()
if len(C)==0:
    print('TLE')
else:
    print(C[0])

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

inf = 1 << 30
ans = inf

for i in range(n):
    c, x = map(int, input().split())
    
    if x <= t and ans > c:
        ans = c
        
if ans != inf:
    print(ans)
else:
    print("TLE")

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


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

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

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

c.sort(key=lambda x:x[0])
for i in range(N):
  if c[i][1] <= T:
    print( c[i][0])
    exit()
print('TLE')

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

c = []
for i in range(N):
  ci,ti = map(int,input().split())
  c.append([ci,ti])
  
c.sort(key=lambda x:x[0])

for i in range(N):
  if c[i][1] <= T:
    print(c[i][0])
    exit()
print('TLE')

Solution (Python):
N, T = map(int, input().split())
 
c = []
for i in range(N):
    ci, ti = map(int, input().split())
    c.append([ci, ti])
 
c.sort(key=lambda x:x[0])
 
for i in range(len(c)):
    if c[i][1] <= T:
        print(c[i][0])
        exit()
print('TLE')

Solution (Python):

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

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

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

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

c = []
for i in range(N):
    ci, ti = map(int, input().split())
    c.append([ci, ti])

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

for i in range(len(c)):
    if c[i][1] <= T:
        print(c[i][0])
        exit()
print('TLE')

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

*CTf, = filter(lambda ct: ct[1] <= T, CT)
if not CTf:
	print("TLE")
	exit()

minimum = min(CTf, key=lambda ct:ct[0])
print(minimum[0])

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

minimum = min(CT, key=lambda ct:[ct[0], 1001][not(ct[1] <= T)])
print([minimum[0], "TLE"][not(minimum[1] <= T)])

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())
c = []
t = []

for i in range(N):
    a,b = map(int, input().split())
    c.append(a)
    t.append(b)
m = 10000
for i in range(N):
    if t[i] <= T:
        m = min(m, c[i])

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

Solution (Python):
N, T = map(int, input().rstrip().split())
data = [list(map(int, input().rstrip().split())) for _ in range(N)]
data.sort(key=lambda x:x[0])
time = [i[1] for i in data]
cost = [i[0] for i in data]
answer = "TLE"
for i in range(N):
    if time[i] <= T:
        answer = cost[i]
        break
print(answer)

Solution (Python):
n,t=map(int,input().split())
cmin=1001
ans=1001
for i in range(n):
    ci,ti=map(int,input().split())
    if ti<=t and ci<=cmin:
        cmin=ci

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

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

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

l = []
for i in range(n):
    if c[i][1] <= t:
        l.append(c[i][0])
if l == []:
    print("TLE")
else:
    print(min(l))

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

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)

m = 100000
for i in range(len(c)):
    if t[i]<= T:
        if m > c[i]:
            m = c[i]
if m == 100000:
    print("TLE")
else:
    print(m)

Solution (Python):

"""
Created on Sat Apr 20 12:13:24 2019

@author: Yamazaki Kenichi
"""

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

ans = 10**9
for c in A:
    if c[1] <= T:
        ans = min(ans,c[0])

if ans == 10**9:
    print('TLE')
else:
    print(ans)

Solution (Python):

N,T=map(int,input().split())
ctlistlist=[]
for n in range(N):
  ctlist=list(map(int,input().split()))
  if ctlist[1] <= T:
    ctlistlist.append(ctlist)
ctlistlist.sort()
if ctlistlist == []:
  print("TLE")
else:
  print(ctlistlist[0][0])

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

Solution (Python):
n,k = map(int,input().split())
tmp = 10000
for i in range(n):
    c,t = map(int,input().split())
    if k>=t:
        tmp = min(tmp,c)
if tmp==10000:
    print("TLE")
else:
    print(tmp)

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

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

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

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

Solution (Python):


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


cost = 1001
getroad = 0
for j in range(n):
    if data[j][1] <= tc:
        if cost > data[j][0]:
            cost = data[j][0]
            getroad += 1


if getroad == 0:
    print("TLE")
else:
    print(cost)

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

Solution (Python):


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

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



INF = 10**4
cost = INF








for i, risuto in enumerate(a):
    if risuto[1] <= T and  risuto[0] <= cost:
        cost = risuto[0]





if cost == INF:
    cost = 'TLE'

print(cost)

Solution (Python):

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

cnt=0
ans =1000
for i in range(N):
    x =[int(j) for j in input().split()]
    
    if x[1]<=T:
        ans=min(ans,x[0])
        cnt+=1
if cnt>0:
    print(ans)
else:
    print('TLE')

Solution (Python):
n,tl = map(int,input().split())
cs = []
ts = []

for i in range(n):
  c, t = map(int,input().split())
  if t <= tl:
    cs.append(c)

min = 10000000
if len(cs) == 0:
  print('TLE')
else:
  for i in cs:
    if i < min:
      min = i
  print(min)

Solution (Python):
import sys
n,t = list(map(int, input().split()))
imincost=1001
for _ in range(n):
    c_,t_ = list(map(int, input().split()))
    if t_ <= t and c_ <imincost:
        imincost = c_
print(imincost if imincost != 1001 else "TLE")

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

Solution (Python):

import sys

ans = sys.maxsize

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

if ans == sys.maxsize:
    print("TLE")
else:
    print(ans)

Solution (Python):

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

m = [e[0] for e in B if e[1] <= T]

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

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

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

Solution (Python):
N, T = [int(elem) for elem in input().split()]
min_cost = None
min_cost_time = None
for i in range(0, N):
  c, t = [int(elem) for elem in input().split()]
  if t <= T:
    if min_cost is None:
      min_cost = c
      min_cost_time = t
    else:
      if c < min_cost:
        min_cost = c
        min_cost_time = t
if min_cost is None:
  print('TLE')
else:
  print(min_cost)

Solution (Python):
n,l=map(int,input().split())
ans=999999
for _ in range(n):
  c,t=map(int,input().split())
  if t<=l:
    if c<ans:
      ans=c
if ans==999999:
  print('TLE')
else:
  print(ans)

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

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

if num != 1001:
    print(num)
else:
    print('TLE')

Solution (Python):
n, t = map(int, input().split())
ct = []
for i in range(n):
    ct.append(list(map(int, input().split())))
num = 1001
has_tle = False

for i in range(n):
    if t >= ct[i][1]:
        if num >= ct[i][0]:
            num = ct[i][0]
        has_tle = True

if has_tle == True:
    print(num)
else:
    print('TLE')

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

for i in range(n):
    p = input().split()
    c.append(int(p[0]))
    t.append(int(p[1]))

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

possibleTimes = []
for i in args:
    possibleTimes.append(c[i])

print("TLE" if possibleTimes == [] else min(possibleTimes))

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

Solution (Python):
N,T=map(int,list(input().split()))
c=1001
for i in range(N):
  ct,tc=map(int,list(input().split()))
  if T>=tc and c>=ct:
    c=ct
if c==1001:
  c="TLE"
print(c)

Solution (Python):
n, t_limit = map(int, input().split())
cts = [list(map(int, input().split())) for _ in range(n)]
min_c = 10000
for c, t in cts:
    if t <= t_limit and c < min_c:
        min_c = c
if min_c == 10000:
    print('TLE')
else:
    print(min_c)

Solution (Python):
N,T=map(int,input().split())
cost=10**3
ans=0
for i in range(N):
  c,t=map(int,input().split())
  if t<=T:
    if c<=cost:
      cost=c
      ans=i+1
if ans==0:
  print("TLE")
else:
  print(cost)

Solution (Python):

import sys


def solve(N: int, T: int, c: "List[int]", t: "List[int]"):
    ret = float('inf')
    for i in range(N):
        if t[i] <= T:
            ret = min(ret, c[i])
    if ret == float('inf'):
        print('TLE')
    else:
        print(ret)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    T = int(next(tokens))  
    c = [int()] * (N)  
    t = [int()] * (N)  
    for i in range(N):
        c[i] = int(next(tokens))
        t[i] = int(next(tokens))
    solve(N, T, c, t)

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:
        pass
    else:
        cost.append(x)

        
print('TLE' if len(cost) == 0 else min(cost))

Solution (Python):

import sys
import copy
from bisect import bisect_left

def main():
	N, T = map(int, input().split(" "))
	CT = []
	isOK = False
	for _ in range(N):
		c, t = map(int, input().split(" "))
		if t <= T:
			isOK = True
			CT.append((c, t))
	
	if isOK == False:
		print("TLE")
		sys.exit()
	
	CT.sort()
	c, t = CT[0]
	print(c)
	
	
if __name__ == "__main__":
	main()

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

Solution (Python):
N, T = map(int, raw_input().split())
ans = 'TLE'
for i in range(0, N):
	c, t = map(int, raw_input().split())
	if t <= T:
		if ans == 'TLE':
			ans = str(c)
		elif c < int(ans):
			ans = str(c)
print ans

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

answer = 'TLE'
INF = 100000000
min_cost = INF

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

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

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

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

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

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

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())
ct = [list(map(int, input().split())) for _ in range(n)]
sorted = sorted(list(filter(lambda x: x[1] <= t, ct)))

if sorted == []:
    print("TLE")
else:
    print(sorted[0][0])

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

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

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

Solution (Python):


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

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



INF = 10**4
cost = INF








for i, risuto in enumerate(a):
    if risuto[1] <= T and  risuto[0] <= cost:
        cost = risuto[0]





if cost == INF:
    cost = 'TLE'

print(cost)

Solution (Python):


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

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

cost = 10000000



for i, risuto in enumerate(a):
    if risuto[1] <= T:
        if risuto[0] <= cost:
            cost = risuto[0]

if cost == 10000000:
    cost = 'TLE'

print(cost)

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())
cost = 1001

for i in range(N):
    if t[i] <= T and c[i] < cost:
        cost = c[i]

if cost <= 1000:
    print(cost)
else:
    print('TLE')

Solution (Python):
def main():
	n, t = map(int, input().split())
	possible_home = False
	min_cost = 10**9
	for _ in range(n):
		c, ti = map(int, input().split())
		if ti <= t:
			possible_home = True
			if c < min_cost:
				min_cost = c

	if possible_home:
		print(min_cost)
	else:
		print("TLE")


if __name__ == '__main__':
    main()

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

Solution (Python):
N, T = map(int, input().split())
root = [list(map(int, input().split())) for i in range(N)]
minc = 1001
for c, t in root:
    if t <= T:
        if c <= minc:
            minc = c
if minc == 1001:
    minc = 'TLE'
print(minc)

Solution (Python):
n,t = map(int,input().split())
l = []
tmpcost = 1001
for i in range(n):
  l.append([int(x) for x in input().split()])

for i in range(n):
  if l[i][1] <= t and l[i][0] <= tmpcost:
    tmpcost = l[i][0]
if tmpcost == 1001:
  print("TLE")
else:
  print(tmpcost)

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

Solution (Python):
n,t=map(int,input().split())
c=10**9
for i in range(n):
    ci,ti=map(int,input().split())
    if ti<=t and ci<c:
        c=ci
if c==10**9:
    print("TLE")
else:
    print(c)

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

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

Solution (Python):
N, T = map(int, input().split())
c_t = []
for i in range(N):
    c_t.append(list(map(int, input().split())))
c_t.sort()
min_cost = 10000
for i in range(N):
    if c_t[i][1] <= T and c_t[i][0] < min_cost:
        min_cost = c_t[i][0]
if min_cost > 1000:
    print('TLE')
else:
    print(min_cost)

Solution (Python):
n,T = list(map(int,input().split()))
c = [0]*n
t = [0]*n
cmin = 1001
for i in range(0,n):
    c[i],t[i] = list(map(int,input().split()))
    if t[i] <= T:
        cmin = min(cmin,c[i])

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

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

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

m = sorted(m)
if len(m) == 0:
    print('TLE')
else:
    print(m[0])

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

l = []
for i in range(n):
    if a[i][1] <= t:
        l.append(a[i])
cost = [l[i][0] for i in range(len(l))]
if len(cost)==0:
    print("TLE")
else:
    print(min(cost))

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

Solution (Python):
N,T = map(int,input().split(' '))
HOME_PATH = [tuple(map(int,input().split(' '))) for i in range(N)]


x = None

min = float('inf')

for c,t in HOME_PATH:
  if t <= T and c < min:
    x = t
    min = c
if min == float('inf'):
  print('TLE')
else:
  print(min)

Solution (Python):
N, T = map(int, input().split())
now = 10**9
for i in range(N):
    c, t = map(int, input().split())
    if t <= T:
        now = min (c, now)

if now == 10**9:
    print('TLE')
else:
    print(now)

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

for item in s_ct:
    if item[1] <= T:
        print(item[0])
        exit()

print('TLE')

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

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

Solution (Python):
N, T = map(int, input().split())
path_list = [list(map(int, input().split())) for _ in range(N)]
min_cost = 1001
for path in path_list:
	if T >= path[1] and path[0] < min_cost:
		min_cost = path[0]
print(min_cost if min_cost < 1001 else 'TLE')

Solution (Python):
import numpy as np
n, t = map(int, raw_input().split())
c = []
for i in range(n):
	c.append(map(int, raw_input().split()))
c = np.array(c)
y, x = c.shape
for i in range(y):
	if c[i,1] > t:
		c[i,0] = 9999
if min(c[:,0]) < 9999:
	print min(c[:,0])
else:
	print 'TLE'

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

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

min = 1001
for x, y in a:
  if x < min and y <= t:
    min = x

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

Solution (Python):
n,t=map(int,input().split())
a=[]
b=[]
for i in range(n):
  s,u=map(int,input().split())
  a.append(s)
  b.append(u)
c=[]
for j in range(n):
  if b[j]>t:
    c.append(1001)
  else:
    c.append(a[j])
if c==[1001]*n:
  print('TLE')
else:
  print(min(c))

Solution (Python):
N, T = map(int,input().split())
ct = [[int(i) for i in input().split()]for i in range(N)]
res = 100000
for c, t in ct:
  if t > T:
    continue
  else:
    res = min(res, c)
if res == 100000:
  res = 'TLE'
print(res)

Solution (Python):
n,t = map(int,input().split())
ct_list = [list(map(int,input().split())) for _ in range(n)]
res = []
for c,time in ct_list:
    if time <= t:
        res.append(c)
print(min(res) if len(res)!=0 else 'TLE')

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

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

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

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

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

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

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 c < min_c:
        min_c = c

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

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

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

if min == 9999:
  print('TLE')
else:
  print(min)

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())

ans = []
for i in range(N):
    if t[i] <= T:
        ans.append(i)
if len(ans) > 0:
    print(min([c[x] for x in ans]))
else:
    print('TLE')

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

best = 1001
for c, t in ct:
    if t > T:
        continue
    best = min(best, c)
print(best if best < 1001 else 'TLE')

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

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

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

def main():
    li = list(filter(lambda t: t[-1] <= T, CT))
    if li:
        li.sort(key=lambda t: t[0])
        print(li[0][0])
    else:
        print('TLE')

if __name__ == '__main__':
    main()

Solution (Python):
n,T=map(int,input().split())
ans=9999
flag=0
for _ in range(n):
    c,t=map(int,input().split())
    if T>=t and c<ans:
        ans=c
        flag=1
if flag==0:
    print("TLE")
else:
    print(ans)

Solution (Python):
N,T = list(map(int,input().split()))
CT   = [tuple(map(int,input().split())) for i in range(N)]
MIN = 9999999
for i in CT:
    if MIN > i[0]:
        if T >= i[1]:
            MIN = i[0]
print(MIN if not MIN == 9999999 else "TLE")

Solution (Python):
def main():
    N, T = map(int, input().split())
    data = [tuple(map(int, input().split())) for _ in range(N)]

    less_than_T_data = list(filter(lambda ct: ct[1] <= T, data))

    if less_than_T_data:
        print(min(less_than_T_data, key=lambda ct: ct[0])[0])
    else:
        print('TLE')


if __name__ == '__main__':
    main()

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

ans = 9999

for n 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 = 1001
for i in range(N):
  c, t = map(int, input().split())
  if t <= T:
    cost = min(cost, c)
  else:
    continue

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

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

for x in range(0,N):
    c,t = map(int,input().split())
    ct.append([c,t])


for x in range(N-1,-1,-1):
    if ct[x][1] > T:
        ct.remove(ct[x])
    
if len(ct) == 0:
    print("TLE")
else:
    print(min(ct)[0])

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

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

ans = []

for c in cost:
  if c[1] < T+1:
    ans.append(c)
    
if ans != []:
  ans = sorted(ans, key=lambda x: x[0])
  print(ans[0][0])
else:
  print("TLE")

Solution (Python):
n,T=map(int,input().split())
INF=10**9
cost=INF
flag=0
for i in range(n):
  c,t=map(int,input().split())
  if t<=T:
    cost=min(cost,c)
    flag=1
if flag:
  print(cost)
else:
  print('TLE')

Solution (Python):
def main():
    mincost = float('inf')
    N, T = map(int, input().split())
    for i in range(N):
        c, t =map(int, input().split())
        if t <= T:
            if c < mincost:
                mincost = c
        else:
            pass
    print(mincost) if mincost < float('inf') else print("TLE")

main()

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())
ans = 1e10
for i in range(n):
  a,b = map(int,input().split())
  if b <= t:
    ans = min(a,ans)
if ans == 1e10:
  print("TLE")
else:
  print(ans)

Solution (Python):

from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
mod = 1000000007
sys.setrecursionlimit(1000000)


def A():
    n = I()
    if n == 1:
        print("Hello World")
    else:
        a,b = IR(2)
        print(a+b)
    return


def B():
    n,t = LI()
    a = LIR(n)
    a.sort(key = lambda x:x[1])
    ans = float("inf")
    for i,j in a:
        if j > t:break
        ans = min(i,ans)
    if ans == float("inf"):
        print("TLE")
    else:
        print(ans)
    return


def C():
    n = I()
    a = LIR(n)
    if n == 1:
        print(*a[0])
        quit()
    for cy in range(101):
        for cx in range(101):
            for i in range(n):
                x,y,h = a[i]
                if h > 0:
                    H = abs(x-cx)+abs(y-cy)+h
                    break
            f = True
            for i in range(n):
                x,y,h = a[i]
                if max(H-abs(x-cx)-abs(y-cy),0) != h:
                    f = False
                    break
            if f:
                print(cx,cy,H)
                quit()

def D():
    def factorize(n):
        if n == 1:
            return [1]
        if n<4:
            return [1,n]
        l = [1,n]
        m = n
        z = 2
        while z**2 <= n:
            if m%z == 0:
                l.append(z)
                if m//z != z:
                    l.append(m//z)
            z += 1
        l = list(set(l))
        l.sort()
        return l

    n,m = LI()
    l = factorize(m)
    for i in l[::-1]:
        if n*i <= m:
            print(i)
            quit()


def E():
    return


def F():
    return


def G():
    return


def H():
    return


if __name__ == "__main__":
    B()

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)
print("TLE" if len(l)==0 else min(l))

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