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):
import sys
sys.setrecursionlimit(1000000000)
ii = lambda: int(input())
mis = lambda: map(int, input().split())
lmis = lambda: list(mis())

def main():
    N, T = mis()
    lis = []
    for _ in range(N):
        c,t = mis()
        if t<=T:
            lis.append(c)
    if lis:
        print(min(lis))
    else:
        print('TLE')

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):
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):
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=map(int,input().split())
ans=10000
for i in range(n):
  x,y=map(int,input().split())
  if y<=t:
    ans=min(ans,x)
if ans!=10000:
  print(ans)
else:
  print("TLE")

Solution (Python):
N,T=map(int,input().split())
C=[list(map(int, input().split())) for _ in range(N)]
e=10000
for i in C:
  if T>=i[1] and e>i[0]:
    e=i[0]
print('TLE' if e==10000 else e)

Solution (Python):
N,T=map(int,input().split())
C=[list(map(int, input().split())) for _ in range(N)]
e=[]
for i in C:
  if T>=i[1]:
    e.extend([i[0]])
print('TLE' if len(e)==0 else min(e))

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

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

N, T = map(int,input().split())
ct=[list(map(int, input().split())) for _ in range(N)]
INF = 100000
ans = INF
for i in range(N):
    if ct[i][1] > T: continue
    ans = min(ans,ct[i][0])
if ans == INF:
    ans="TLE"
print(ans)

Solution (Python):
import sys
N, T = map(int, sys.stdin.readline().strip().split())  

cost = 1001
for line in sys.stdin.readlines():
    c, t = map(int, line.strip().split())
    if T >= t:
        cost = min(cost, c)

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

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

Solution (Python):
N, T = map(int, input().split())
C = 1000
flag = 0
for i in range(N):
    c, t = map(int, input().split())
    if t <= T and c <= C:
        C = c
        flag = 1

if flag == 1:
    print(C)
else:
    print('TLE')

Solution (Python):
N, T = map(int, input().split())
cts = []
for i in range(N):
  c, t = map(int, input().split())
  cts.append((c, t))
cts2 = list(filter(lambda ct: ct[1] <= T, cts))
if len(cts2) == 0:
  print("TLE")
  exit()
r = min(map(lambda ct: ct[0], cts2))
print(r)

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 not ans:
  print('TLE')
else:
  ans.sort()
  print(ans[0])

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

for i in range(N):
	ok.append([int(i) for i in input().split()])
		
ok.sort(key=lambda x: x[0])

ans = 1200

for i in range(N):
	if ok[i][1] <= T:
		ans = ok[i][0]
		break
		
	
print("TLE" if ans == 1200 else ans)

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

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

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

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

Solution (Python):

N, T = map(int, input().split())
ct = []
for i in range(N):
    ct.append(list(map(int, input().split())))
ans_list = []
for i in range(N):
    if ct[i][1] <= T:
        ans_list.append(ct[i][0])

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

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

ans = float("inf")

for i in range(N):
    c,t = CT[i]
    if t <= T:
        if ans > c:
            ans = c
            
if ans == float("inf"):
    print("TLE")
else:
    print(ans)

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

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

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

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

Solution (Python):
"""
【ABC112】
B_Time_Limit_Exceeded



import sys


def ILI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def ISI(): return map(int, sys.stdin.readline().rstrip().split())
def II(): return int(sys.stdin.readline().rstrip())
def ISS(): return sys.stdin.readline().rstrip().split()
def IS(): return sys.stdin.readline().rstrip()

N, T = ISI()
min = 999999
for i in range(N):
    c, t = ISI()
    if t <= T:
        if min > c:
            min = c
if min == 999999:
    print("TLE")
else:
    print(min)

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

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

r=2000+t

for _ in range(n):
  a,b=map(int,input().split())
  if b<=t and a<r:
    r=a
if r==2000+t:
  print("TLE")
else:
  print(r)

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

r=2000

for _ in range(n):
  a,b=map(int,input().split())
  if b<=t and a<r:
    r=a
if r==2000:
  print("TLE")
else:
  print(r)

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

c = 2000
for i in list:
    if i[1] <= t and c > i[0]:
        c = i[0]
if c != 2000:
    print(c)
else:
    print("TLE")

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

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

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

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

Solution (Python):


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

min_c =	1001

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

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

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

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

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

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

if __name__ == '__main__':
    main()

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

arr = list(filter(lambda x: x[1] <= T, L))
print(min([x[0] for x in arr]) if arr else 'TLE')

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

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

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

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

if __name__ == "__main__":
    main()

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

Solution (Python):
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  

n, t = na()
ans = 10000
for i in range(n):
    ci, ti = na()
    if ti <= t:
        ans = min(ci, ans)
if ans == 10000:
    print("TLE")
else:
    print(ans)

Solution (Python):
import numpy as np
N,T= [int(i) for i in input().split()]
a=[]
for i in range(N):
	a.append( [int(x) for x in input().split()])
a = np.array(a)
a = a[np.where(a[:,1] <= T)]
print(min(a[:,0]) if len(a) > 0 else "TLE")

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

c = 1001
for i in range(n):
    if ct[i][0] < c and ct[i][1] <= t:
        c = ct[i][0]



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

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

Solution (Python):
N,T = map(int,input().split())
m = 9999
d = 0
for i in range(N):
    c,t = map(int,input().split())
    if t <= T:
        m = min(m,c)
    elif t > T:
        d += 1

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

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

Solution (Python):
n, t = map(int, input().split())
c = []
for _ in range(n):
    ct = tuple(map(int, input().split()))
    if ct[1] <= t:
        c.append(ct[0])
if c != []:
    c.sort()
    print(c[0])
else:
    print("TLE")

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

cost = []

for i in range(N):
    if ct[i][1] <= T:
        cost.append(ct[i][0])

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

Solution (Python):
N, T = map(int, input().split())
min_c = 1001
flag = 0

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

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

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

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

Solution (Python):
N, T, *V = map(int, open(0).read().split())
cs = V[0::2]
ts = V[1::2]
ans = 1001

for i in range(N):
  if(ts[i] > T):
    continue
  if(cs[i] < ans):
    ans = cs[i]

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

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

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

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

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

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

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

if tmp == (114514):
  print("TLE")
else:
  print(tmp)

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

for h in range(n):
  T.append(ct[h][1])
  
if min(T) > t:
  print("TLE")
  exit()
else:
  for j in range(n):
    if ct[j][1] <= t:
      c = ct[j][0]
      k = j
      break
 

for i in range(k+1,n):
  if ct[i][1] <= t:
    c = min(c,ct[i][0])
    
print(c)

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

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)
print((m,"TLE")[m==1001])

Solution (Python):
from operator import itemgetter
N,T=map(int,input().split())
st=sorted([list(map(int,input().split())) for i in range(N)],key=itemgetter(1))
INF=float("inf")
cost=INF
for cn,tn in st:
  if tn<=T:
    cost=min(cost,cn)
  else:
    break
print("TLE" if cost==INF else cost)

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

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

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

temp = []
for i in range(N):
    if li[i][1] <= T:
        temp.append(li[i][0])

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

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

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

Solution (Python):
N, T = map(int, input().rstrip().split())
n = sorted([list(map(int, input().rstrip().split())) for i in range(N)], key=lambda x: x[1])
INF = float("inf")
cost = INF
for cn, tn in n:
    if T >= tn:
        cost = min(cost, cn)
    else:
        break

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

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

    ans = float('inf')

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

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

main()

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

Solution (Python):
def test():
    n,t = map(int,input().split())
    c = []
    d = []
    for i in range(n):
        a,b = map(int,input().split())
        c.append(a)
        d.append(b)

    e = {i:j for i,j in zip(c,d)}
    d = [i for i in e if e[i] <= t]

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


if __name__ == "__main__":
    test()

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

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

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

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)

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

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

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

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

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

ct.sort()

for c, t in ct:
  if t <= T:
    print(c)
    exit(0)
print('TLE')

Solution (Python):
import sys
n,t=map(int,input().split())
cts=[list(map(int,input().split())) for _ in range(n)]
cts.sort(key=lambda x:(x[0],x[1]))

for ct in cts:
  if ct[-1]<=t:
    print(ct[0])
    sys.exit()

print('TLE')

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

for _ 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 = 9999
for i in range(n):
  c,y = map(int,input().split())
  if y<=t:
    m=min(m,c)
print("TLE" if m==9999 else m)

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

    if min_c == float('inf'):
        return "TLE"
    return min_c

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

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

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

print('TLE' if not list else min(list))

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

Solution (Python):
n, t = map(int, input().split())
cs = []
for _ in range(n):
    c, ti = map(int, input().split())
    if ti <= t:
        cs.append(c)
if cs:
    print(min(cs))
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):
a,b = map(int, input().split())
cl=[]
tl=[]
for i in range(a):
    c,t = map(int, input().split())
    cl.append(c)
    tl.append(t)
    
ind=0
resut_list=[]
for p in range(a):
    if tl[ind]<=b:
        resut_list.append(cl[ind])   
    ind+=1
    
if len(resut_list)==0:
  print("TLE")  

else:
  print(min(resut_list))

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

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

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

Solution (Python):
x,y = map(int,input().split())

cost = 1001

for i in range(x):
    a,b = map(int, input().split())
    if b <= y:
        cost = min(cost,a)

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

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

Solution (Python):
N, T = (int(i) for i in input().split())
c_min = 10000
for i in range(N):
    c, t = (int(i) for i in input().split())
    if t <= T:
        if c < c_min:
            c_min = c
print(c_min if c_min != 10000 else 'TLE')

Solution (Python):
N, T = map(int, input().split())
min = 100000
flg = False
for i in range(N):
    min_temp, T_temp = map(int, input().split())
    if min_temp < min and T_temp <= T:
        min = min_temp
        flg = True
print(min if flg == True 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: m = min(m,c)
print("TLE" if m == 1001 else m)

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

for j in range(n):
    l.append([int(i) for i in input().split()])

c = 1001
c_i = -1

for i in range(n):
    
    if l[i][1] <= t:
        
        if l[i][0] < c:
            
            c = l[i][0]
            c_i = i
            

if c_i != -1:
    print(l[c_i][0])
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)      

ans = []
for i, v in enumerate(t):
    if v <= T:
        ans.append(c[i])

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

Solution (Python):
N,T=map(int, input().split())
A=[[0]*2 for _ in range(N)]
for i in range(N):
    A[i][1], A[i][0] = map(int,input().split())
A.sort()

import bisect
idx = bisect.bisect_right(A,[T,1001])

if idx==0:
    print('TLE')
else:
    print(min(A[:idx],key=lambda l:l[1])[1])

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

Solution (Python):
N, T = [int(x) for x in input().split()]
res = 1001
for _ in range(N):
  c, t = [int(x) for x in input().split()]
  if c < res and t <= T:
    res = c

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

Solution (Python):
N, T = [int(x) for x in input().split()]
res = 1001
for _ in range(N):
  c, t = [int(x) for x in input().split()]
  if c < res and t <= T:
    res = c

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

Solution (Python):
N, T = [int(x) for x in input().split()]
res = 1001
for _ in range(N):
  c, t = [int(x) for x in input().split()]
  if t <= T and c < res:
    res = c

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

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

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

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

min=50000

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

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

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

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

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

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

Solution (Python):
import sys
from fractions import gcd
import bisect
 
stdin = sys.stdin
 
ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
s = lambda h: [list(map(int, stdin.readline().split())) for i in range(h)]

n, T = na()
cost = []
for _ in range(n):
        c, t = na()
        if t <= T:
                cost.append(c)
if len(cost) != 0:
        print(min(cost))
else:
        print("TLE")

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

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


minV = 10000
ans = 0

for i in range(n):
    if ct[i][1] > t:
        continue
    elif ct[i][0] < minV:
        minV = ct[i][0]
        ans = i + 1

if minV == 10000:
    print('TLE')
else:
    print(minV)

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

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

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(0, n):
    c, t_i = map(int, input().split())
    if t_i <= t:
        min_c = min(min_c, c)

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

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

c_min = 1001
flag = 0
for i in range(n):
    cost,time = map(lambda x:int(x), input().split())
    if time > t:
        pass
    else:
        if cost < c_min:
            c_min = cost
            flag = 1

if flag == 0:
    print("TLE")
else:
    print(c_min)

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

Solution (Python):
def solve():
    N, T = map(int, input().split())
    ct = list(list(map(int, input().split())) for _ in range(N))
    if any([t <= T for c, t in ct]):
        return min([c for c, t in ct if t <= T])
    else:
        return "TLE"


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

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

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

Solution (Python):
ans=1001
N,T=map(int,input().split())
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())
ans="TLE"
c_min=1000
for i in range(N):
  c, t = map(int, input().split())
  if t <= T:
    c_min = min(c, c_min)
    ans = c_min
print(ans)

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

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

for i in range(n):
    l[i][1],l[i][0]=map(int,input().split())
l.sort()
p=[]
for i in range(n):
    if l[i][0]<=t:
        p.append(l[i][::-1])
if len(p)==0:
    print('TLE')
else:
    p.sort()
    print(p[0][0])

Solution (Python):
n, tt = map(int, input().split())
mi = 10 ** 9
for i in range(n):
    c, t = map(int, input().split())
    if tt >= t:
        mi = min(c, mi)
print(mi if mi != 10 ** 9 else "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:cost=min(cost,c)
print("TLE" if cost==1001 else cost)

Solution (Python):
n,tl = map(int,input().split())
cost = []
time = []
cost2 = []
for i in range(n):
  c,t = map(int,input().split())
  cost.append(c)
  time.append(t)
for y,z in zip(cost,time):
  if z<=tl:
    cost2.append(y)    
print("TLE" if min(time)>tl else min(cost2))

Solution (Python):
ans = 10000
n,t = map(int,input().split())
for i in range(n):
    ci,ti = map(int,input().split())
    if ti <= t:
        ans = min(ans,ci)
if ans == 10000:
    ans = "TLE"

print(ans)

Solution (Python):
def resolve():
    N,T = map(int,input().split())
    C = [list(map(int,input().split())) for _ in range(N)]
    minc = 10**10
    for i in range(N):
        if C[i][1]<=T:
            minc = min(minc,C[i][0])
    print(minc if minc!=10**10 else 'TLE')
resolve()

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(cost) == 0:
  	print('TLE')
else:
    print(min(cost))