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

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

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

Solution (Python):

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

costs = [c for c, t in ct if t <= T]

if costs:
    print(min(costs))
else:
    print('TLE')

Solution (Python):
n, T = map(int, input().split())
keiro = []
for _ in range(n):
    c, t = map(int, input().split())
    if t <= T:
        keiro.append((c,t))
if len(keiro) == 0:
  print('TLE')
else:
  sortedkeiro = sorted(keiro, key= lambda x: x[0])
  print(sortedkeiro[0][0])

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

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

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

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

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

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

Solution (Python):




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




n,b=map(int,input().split())
ans=100**4
x=[list(map(int,input().split())) for _ in range(n)]
for i in range(n):
  if x[i][1]<=b:
    ans=min(ans,x[i][0])
if ans==100**4:
  print('TLE')
else:
  print(ans)

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

if(min(t) > T):
    print("TLE")
    exit()
else:
    ans = 1000
    for i in range(N):
        if t[i] <= T:
            ans = min(ans, c[i])

print(ans)

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

Solution (Python):



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

cost_time = [list(map(int,input().split())) for i in range(n)]
result =float('inf')
inf =  float("inf")
for i in range(n):
    time = cost_time[i][1]
    if t >= time and result >= cost_time[i][0]:
       result = cost_time[i][0]
if result == inf:
    print("TLE")
else:
    print(result)

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

ct=sorted(ct)
answer="TLE"

for i in range(N):
    if ct[i][1]<=T:
        answer=ct[i][0]
        break
print(answer)

Solution (Python):
N, T = map(int, input().split())
ans = 10 ** 4
root = [list(map(int, input().split())) for _ in range(N)]

for i in range(N):
    if root[i][1] > T:
        continue
    else:
        ans = min(ans, root[i][0])

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

Solution (Python):
N,T = map(int,input().split())
root = []
ans = 10**4
for i in range(N):
    c,t = map(int,input().split())
    root.append([c,t])
for i in range(N):
    if root[i][1] > T:
        continue
    else:
        ans = min(ans,root[i][0])
if ans == 10**4:
    print("TLE")
else:
    print(ans)

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

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(min(l) if l!=[] else "TLE")

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

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

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

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

    print('TLE' if min_cost == 1001 else min_cost)


if __name__ == '__main__':
    main()

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

else:
    print(min(m))

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

ans = 1001
for c, t in CT:
    if t <= T:
        ans = min(ans, c)
print(ans if ans < 1001 else 'TLE')

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

min_cost = float('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 == float('inf'):
    print('TLE')
else:
    print(min_cost)

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

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

if len(clist)== 0:
  print('TLE')
  exit()

print(min(clist))

Solution (Python):
N, T = map(int, input().split())
ans = float('inf')
for _ in range(N):
  a, b = map(int, input().split())
  if b <= T:
    ans = min(a, ans)
if ans == float('inf'):
  ans = 'TLE'
print(ans)

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

ans = 1001
for c,t in ct:
    if t > T:
        continue
    if ans > c:
        ans = c

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

Solution (Python):
n, t = map(int, input().split())
m = 114514
for _ in range(n):
    c, s = map(int, input().split())
    if s <= t and c < m:
        m = c
if m == 114514:
    print("TLE")
else:
    print(m)

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

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

INF = 1000000007
ans = INF
for r in root:
  if r[1] > t:
    continue
  ans = min(ans, r[0])

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

Solution (Python):
def main():
    n, T = map(int, input().split())
    cts = [list(map(int, input().split())) for _ in range(n)]
    ans = float("inf")
    for ct in cts:
        c, t = ct
        if t <= T:
            ans = min(ans, c)

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

    print(ans)


if __name__ == "__main__":
    main()

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

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

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

m=99999
for i in range(n):
    if l[i][1]<=t:
        m=min(l[i][0],m)

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

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

ans = float("inf")
for _ 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())
C = [0]*N
for i in range(N):
  C[i] = list(map(int, input().split()))

C.sort()
for c,t in C:
  if t<=T:
    print(c)
    exit()
print('TLE')

Solution (Python):

n,T=map(int,input().split())
c=[]
t=[]
ans=10001
for i in range(n):
    a,b=map(int,input().split())
    c.append(a)
    t.append(b)
for i in range(n):
    if t[i]>T:
        continue
    ans=min(ans,c[i])
if ans==10001:
    print("TLE")
else:
    print(ans)

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

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

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

Solution (Python):
N, T = map(int, input().split())
ans = float('inf')
cost = 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(ans)
else:
  print('TLE')

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

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

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

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

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

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

ct = []

for i in range(N):
    ct.append([int(i) for i in input().split()])

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

ans = 1001

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

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

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

Solution (Python):
import sys
import os


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N, T = list(map(int, sys.stdin.readline().split()))

    ret = 1001
    for n in range(N):
        c, t = list(map(int, sys.stdin.readline().split()))
        if T >= t: ret = min(c, ret)

    print('TLE' if ret == 1001 else ret)


if __name__ == '__main__':
    main()

Solution (Python):
import sys
import os


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N, T = list(map(int, sys.stdin.readline().split()))
    ct = [list(map(int, sys.stdin.readline().split()))for i in range(N)]

    ret = 1001
    for n in range(N):
        if T >= ct[n][1] and ret > ct[n][0]:
            ret = ct[n][0]

    print('TLE' if ret == 1001 else ret)


if __name__ == '__main__':
    main()

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

if res == 10 ** 100:
    print('TLE')
else:
    print(res)

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

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())
costl=[]
for i in range(N):
    c,t=map(int,input().split())
    if t<=T:
        costl.append(c)

if costl:
    print(min(costl))
else:
    print('TLE')

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

ans = 10 ** 10
for i in range(n):
    cost = ct[i][0]
    time = ct[i][1]
    if time <= t:
        ans = min(ans, cost)

if ans == 10 ** 10:
    ans = 'TLE'

print(ans)

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

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

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

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

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

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

Solution (Python):

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

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

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())
cnt = 1000
jdg = False
for _ in range(N):
    c, t = map(int,input().split())
    if t <= T: 
        cnt = min(cnt,c)
        jdg = True
        
if jdg:
    print(cnt)
else:
    print("TLE")

Solution (Python):
N, T = list(map(int, input().split()))
A = [list(map(int, input().split())) for _ in range(N)]
ans, sav = 1001, 0
for i in A:
    if i[1] <= T:
        sav = i[0]
        if ans > sav:
            ans = sav
if ans > 1000:
    ans = "TLE"
print(ans)

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 l == []:
    print('TLE')
else:
    print(min(l))

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

Solution (Python):
n,T = map(int,input().split())
min_c = 10**4
for i in range(n):
    c,t = map(int,input().split())
    if t<=T and min_c>c:
        min_c = c
print('TLE' if min_c==10**4 else min_c)

Solution (Python):
N, T = map(int, input().split())
c = [0 for _ in range(N)]
t = [0 for _ in range(N)]
for i in range(N):
  c[i], t[i] = map(int, input().split())
c_min = max(c)
if min(t) > T:
  print("TLE")
  quit()
  
for i in range(N):
  if t[i] <= T:
    if c[i] < c_min:
      c_min = c[i]
print(c_min)

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):
import math
import itertools
import statistics

n, T = list(map(int, input().split()))
c = []
t = []
for i in range(n):
    x,y = [int(j) for j in input().split()]
    c.append(x)
    t.append(y)

m = 10000
for i in range(n):
    if t[i] <= T:
        if c[i] < m:
            m = c[i]

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

Solution (Python):
N,T=map(int,input().split())
c=[list(map(int,input().split())) for i in range(N)]
mincost=10**5
for i in range(N):
    if c[i][1]>T:
        continue
    else:
        if c[i][0]<mincost:
            mincost=c[i][0]
print(mincost if mincost!=10**5 else 'TLE')

Solution (Python):
n,t=[int(i) for i in input().split()]
l=[]
def f(l,L,t):
  if L[1] <= t:
    l.append(L[0])
  return l
for i in range(n):
  L=[int(i) for i in input().split()]
  f(l,L,t)
if l==[]:
  print("TLE")
else:
  print(min(l))

Solution (Python):
import math
import string


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//math.factorial(n-r)*math.factorial(r)


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

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

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

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

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

ct = [[int(i) for i in input().split()] for _ in range(n)]

x=[]
for i in range(n):
  if ct[i][1] <= t:
    x.append(ct[i][0])
    
    
x.sort()

if len(x) != 0:
  print(x[0])
else:
  print("TLE")

Solution (Python):
n,T=map(int,input().split())
st=[list(map(int,input().split())) for _ in range(n)]
st=sorted(st,key=lambda x:(x[0],x[1]))
for i in range(n):
  if st[i][1]<=T:
    print(st[i][0])
    exit()
print('TLE')

Solution (Python):
N, T = map(int, input().split())
cost = float('inf')
FLAG = False

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

if (FLAG):
    print(cost)
else:
    print('TLE')

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

list_ans = []
for i in range(N) :
    if list_t[i] <= T :
        list_ans.append(list_c[i])

if list_ans :
    print(min(list_ans))
else :
    print("TLE")

Solution (Python):
N, T = map(int, input().split())
li = [list(map(int, input().split())) for i in range(N)]
ans = 20000
for l in li :
    if l[1] <= T and l[0] < ans :
        ans = l[0]
print(ans if ans != 20000 else "TLE")

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

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

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

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

Solution (Python):
n,t = map(int,input().split())
cost = []
time = []
ncost = []
f = 0
e = 0
for i in range(n):
    c,T = input().split()
    cost.append(int(c))
    time.append(int(T))

for i in time:
    if i > t:
        e += 1
    
if e == n:
    print('TLE')
    
for i in range(n):
    if time[i] <= t:
        ncost.append(cost[i])
        f = 1
    else:
        pass
if  f == 1:
    print(min(ncost))

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

max=1001
for i in range(N):
    if ct[i][1]>T:
        continue
    else:
        if ct[i][0]<max:
            max=ct[i][0]
if max==1001:
    print('TLE')
else:
    print(max)

Solution (Python):
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    n,T=INTM()
    ct=1001
    for i in range(n):
        c,t=INTM()
        if T>=t:
            ct=min(ct,c)
    if ct==1001:
        print('TLE')
    else:
        print(ct)
if __name__ == '__main__':
    do()

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

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

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

Solution (Python):
n,t=map(int,input().split())
c_t=[list(map(int,input().split())) for _ in range(n)]
ans=[]
for i in range(n):
    if c_t[i][1]<=t:
        ans.append(c_t[i][0])
print(min(ans) if sum(ans)>0 else "TLE")

Solution (Python):



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


temp_list=[]
for c,t in ct_list:
    if t <= T:
        temp_list += [[c,t]]

if temp_list == []:
    print("TLE")
else:
    index=0
    c_min=ct_list[0][0]
    for i,[c,t] in enumerate(temp_list):
        if c_min > c:
            index = i
            c_min = c
    
    print(c_min)

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

m = 1001
for _ in range(n):
    ci, ti = map(int,input().split())
    if ti > t:
        continue
    if ci < m:
        m = ci
print("TLE" if m == 1001 else m)

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

Solution (Python):
import sys
 
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni = lambda: int(ns())
nin = lambda y: [ni() for _ in range(y)]
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda y: [na() for _ in range(y)]
ns = lambda: stdin.readline().rstrip()
nsn = lambda y: [ns() for _ in range(y)]
ncl = lambda y: [list(ns()) for _ in range(y)]
nas = lambda: stdin.readline().split()

N, T = na()
ct = nan(N)

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

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

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

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

Solution (Python):
def solve():
    N, T = [int(_) for _ in input().split()]
    res = 100000
    for i in range(N):
        c, t = [int(_) for _ in input().split()]
        if t <= T:
            res = min(res, c)
    if res < 1001:
        return res
    else:
        return 'TLE'

if __name__ == '__main__':
    print(solve())

Solution (Python):

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

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:
        ans=min(ans,c)
print(ans if ans!=10**10 else 'TLE')

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

Solution (Python):
C=[];D=[];cost=1001;num=-1
N,T=map(int,input().split())
for i in range(N):
  c,t=map(int,input().split())
  C.append(c)
  D.append(t)
for i in range(N):
  if D[i]<=T:
    if C[i]<cost:
      cost=C[i]
      num=i
      
print(C[num] if num!=-1 else "TLE")

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

ans = 10**15

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

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

if m < 1000000000:
    print(m)
else:
    print("TLE")

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

INF = 10**9

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

answer = min_cost if min_cost < INF else 'TLE'
print(answer)

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

Solution (Python):
import sys
def input(): return sys.stdin.readline().rstrip()

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

if __name__ == '__main__':
    main()

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

Solution (Python):
N,T=map(int,input().split())
c=[]
t=[]
d=[]
for _ in range(N):
  c_i,t_i=map(int,input().split())
  c.append(c_i)
  t.append(t_i)
if min(t)>T:
  print("TLE")
  exit()
for i in range(N):
  if t[i]<=T:
    d.append(c[i])
w=min(d)
print(w)

Solution (Python):
n,t = map(int, input().split())
sh = float("inf")
l = list()

for i in range(n):
    a,b = map(int, input().split())
    if t >= b:
        if a < sh:
            sh = a
if sh == float("inf"):
    print("TLE")
else:
    print(sh)

Solution (Python):
n,T = [int(x) for x in input().split()]
ct = []
for _ in range(n):
    c,t = [int(x) for x in input().split()]
    ct.append([c,t])

ans = 10000
for i in range(n):
    if ct[i][1] > T:
        pass
    else:
        ans = min(ct[i][0],ans)

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

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

Solution (Python):
n, T = map(int, input().split())
    
ans = 10**9
for _ in range(n):
    c, t = map(int, input().split())
    if t <= T and c < ans:
        ans = c
    
if ans == 10**9:
    print('TLE')
else:
    print(ans)

Solution (Python):
n, T = map(int, input().split())
l = []
for _ in range(n):
    c, t = map(int, input().split())
    l.append([c, t])
    
l.sort()
for i in range(n):
    if l[i][1] <= T:
        print(l[i][0])
        break
    if i == n-1 and l[i][1] > T:
        print('TLE')

Solution (Python):
N, T = map(int, input().split())
ct = []
for _ in range(N):
    c, t = map(int, input().split())
    if t > T:
        pass
    else:
        ct.append([c,t])
try:
    print(sorted(ct, key=lambda x: x[0])[0][0])
except IndexError:
    print('TLE')

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

if mincost == 1001:
  print('TLE')
if mincost < 1001:
  print(mincost)

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

Solution (Python):
n,tl=map(int,input().split())
c=[]
t=[]
cl=[1001]
for i in range (n):
    c1,t1=[int(i) for i in input().split()]
    c.append(c1)
    t.append(t1)

for i in range(n):
    if  int(t[i])<=tl:
        cl.append(c[i])
if min(cl)==1001:
    print('TLE')
else:
    print(min(cl))

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

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

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

print("{}".format(min_cost if min_cost!=10000 else "TLE"))

Solution (Python):
n,t=map(int,input().split())
a=[[int(i) for i in input().split()] for l in range(n)]
a=sorted(a)
for x in a:
    if x[1]<=t:
        print(x[0])
        exit(0)
print("TLE")

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

ans=1<<30
for i in range(N):
    if t[i]<=T and c[i]<ans:ans=c[i]
if ans==1<<30:ans="TLE"
print(ans)

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)

print(ans if ans!=10**4 else 'TLE')

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

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

Solution (Python):
N,T=map(int,input().split())
INF=float('inf')
ans=INF

for i 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):


import numpy as np


def main():
    N, T = map(int, input().split())
    CT = np.array([list(map(int, input().split())) for _ in range(N)])
    roots = CT[(CT[:, -1] <= T)]
    if roots.size == 0:
        print('TLE')
    else:
        print(np.min(roots, axis=0)[0])


if __name__ == "__main__":
    main()