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 = []
for i in range(N):
    ct.append(list(map(int, input().split())))

c_min = 1001
for i in range(N):
    if (ct[i][1] <= T) and (ct[i][0] <= c_min):
        c_min = ct[i][0]

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

Solution (Python):
from operator import itemgetter

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

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

	costs = sorted(costs, key=itemgetter(0))
	for i in range(n):
		if costs[i][1] <= t:
			print(costs[i][0])
			return
	print("TLE")
	return

main()

Solution (Python):
I = lambda: list(map(int, input().split()))

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

minc = 9999

for i in range(N):
    if T >= ct[i][1] and minc >= ct[i][0]:
        minc = ct[i][0]

print(minc if minc != 9999 else 'TLE')

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

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

minc = 9999

for i in range(N):
    if T >= ct[i][1] and minc >= ct[i][0]:
        minc = ct[i][0]

print(minc if minc != 9999 else 'TLE')

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

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

Solution (Python):
N,T=list(map(int,input().split()))
l=[]
for i in range(N):
  l.append(list(map(int,input().split())))
l.sort(key=lambda x:(x[1],x[0]))

if l[0][1] > T:
  print('TLE')
  quit()
else:
  minimum = l[0][0]

for i in range(1,N):
  if l[i][1] > T:
    break
  elif l[i][1] == l[i-1][1]:
    pass
  else:
    minimum = min(l[i][0], minimum)
print(minimum)

Solution (Python):
n, T = map(int, input().split())
min_ = 10**10
for _ in range(n):
    c, t = map(int, input().split())
    if t <= T:
        min_ = min(c, min_)

if min_ != 10**10:
    print(min_)
else:
    print("TLE")

Solution (Python):
n,t=map(int,input().split())
l=[]
for i in range(n):
    l.append(list(map(int,input().split())))
c=[]
flag=False
for i in range(n):
    if l[i][1]<=t:
        flag=True
        c.append(l[i][0])
    else:
        pass
if flag:
    print(min(c))
else:
    print("TLE")

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

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

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

Solution (Python):
N,T = map(int,input().split())
c_min = 1 << 60
ans = 'TLE'
for i in range(N):
    c,t = map(int,input().split())
    if t <= T:
        if c_min > c:
            c_min = c
            ans = str(c_min)
print(ans)

Solution (Python):
n, time = map(int, input().split())
list = []
list_ok = []

for i in range(n):
    c, t = map(int, input().split())
    object = [c, t]
    list.append(object)
    
count = 0

for j in range(n):
    if list[j][1] > time:
        continue
    else:
        list_ok.append(list[j][0])
        count += 1

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

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

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

print("TLE") if count == N else print(min)

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

Solution (Python):
N, T = map(int, input().split())
ct = [None] * N
for i in range(N):
  ct[i] = list(map(int, input().split()))
ct = sorted([x[0] for x in ct if x[1] <= T]) + ['TLE']
print(ct[0])

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

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

Solution (Python):
N,Y = map(int,input().split())
ct = {}
for i in range(N):
    temp = [int(i) for i in input().split()]
    if temp[1] > Y:
        pass
    else:
        ct[temp[0]] = temp[1]

if len(ct) > 0:
    ct = sorted(ct.items(),key=lambda x: x[0])
    print(ct[0][0])
else:
    print("TLE")

Solution (Python):


import math
import sys
import heapq
from operator import itemgetter
import itertools
input = sys.stdin.readline











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

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

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

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

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

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

l = []

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

ans = float('inf')

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

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

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

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

time_list = list(filter(lambda x: x[1] <= t, li_keiro))

if len(time_list) == 0:
    print("TLE")
else:
    print(min(time_list, key=lambda x: x[0])[0])

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

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

min = float("inf")
cost = 5000
for i,v in enumerate(e):
    if v[1] <= t:
        if v[0] <= cost:
            min = v[1]
            cost = v[0]
            


if min == float("inf"):
    print("TLE")
else :
    print(cost)

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

li = []
for i in range(n):
  if ct[i][1] <= t:
    li.append(ct[i])
  else:
    continue

if len(li) > 0:
  li2 = []
  for i in range(len(li)):
    li2.append(li[i][0])
  print(min(li2))
else:
  print("TLE")

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

data = []

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

Solution (Python):
N, TL = map(int, input().split())
C = []
T = []
for i in range(N):
    a, b = map(int, input().split())
    C.append(a)
    T.append(b)
cost = 10000
for i in range(N):
    if T[i] <= TL:
        cost = min(cost, C[i])
if cost == 10000:
    print("TLE")
else:
    print(cost)

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

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

if not cost:
    print("TLE")
else:
    cost.sort()
    print(cost[0])

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

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

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

Solution (Python):
from sys import stdin

N, T, *ct = map(int, stdin.read().split())

cost = 1001
for i in range(N):
    c, t = ct[2*i:2*(i+1)]
    if t > T:
        continue
    cost = min(cost, c)

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

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

Solution (Python):
import numpy as np
from sys import stdin
N,T=[int(x) for x in stdin.readline().rstrip().split()]

a=[]
for i in range(N):
    a.append([int(x) for x in stdin.readline().rstrip().split()])

flag=0
cost=1000
for data in a:
    if data[0] <= cost and data[1] <= T:
        cost=data[0]
        flag=1
if flag == 0:
    print("TLE")
else:
    print(cost)

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

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

    
route_ = list(filter(lambda x:x[1] <= T, route))


if len(route_) == 0:
    print('TLE')
else:
    print(min(route_, key = lambda x:x[0])[0])

Solution (Python):


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

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


cs = []
for ct in cts:
    if ct[1] <= T:
        cs.append(ct)

if len(cs) == 0:
    print("TLE")
    exit()

ans = 1000

for c in cs:
    ans = min(ans, c[0])

print(ans)

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

    if ct[0][0]<=t:
        cos=[[i[1],i[0]] for i in ct]
        cos.sort()
        for i in cos:
            if i[1]<=t:
                print(i[0])
                exit()
    else:
        ans='TLE'
    return ans

print(tl())

Solution (Python):
i=lambda:map(int,input().split())
N,T=i()
a=1001
for _ in[0]*N:
  c,t=i()
  if t<=T and a>=c:a=c
print('TLE'*(a>1000)or a)

Solution (Python):

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

Solution (Python):
def main():
  n, T = map(int, input().split())
  kiro = []
  for _ in range(n):
    c_i, t_i = map(int, input().split())
    kiro.append([c_i, t_i])

  
  
  kiro = sorted(kiro, key=lambda x: x[0])

  for c, t in kiro:
    if t <= T:
      print(c)
      return
  print('TLE')

main()

Solution (Python):
def main() -> None:
    N, T = map(int, input().split())
    R = [[int(i) for i in input().split()] for _ in range(N)]
    ROK = [x for x in R if int(x[1]) <= T]
    if ROK:
        ROK.sort(key=lambda x: x[0])
        print(ROK[0][0])
    else:
        print('TLE')


if __name__ == '__main__':
    main()

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

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):
result=[]
n,Time=[int(i) for i in input().split()]
for i in range(n):
    c,t=[int(j) for j in input().split()]
    if t<=Time:
        result.append(c)
if len(result)==0:
    print("TLE")
else:
    print(sorted(result)[0])

Solution (Python):
import numpy as np

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

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

selected_c = np.array(selected_c)
if(len(selected_c)==0):
    print("TLE")
else:
    print(np.min(selected_c))

Solution (Python):
n,t = list(map(int,input().split()))
in_time = list()
           
for i in range(n):
    a,b =  list(map(int,input().split()))
    if t >= b:
        in_time.append(a)

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

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 = sorted(c_t, key=lambda x:x[1])
if c_t[0][1]>T:
    print('TLE')
    import sys
    sys.exit()
ans = c_t[0][0]
for i in range(N):
    if c_t[i][1]>T:
        break
    if ans>c_t[i][0]:
        ans = c_t[i][0]
print(ans)

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

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

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

flag=False
for path in paths:
  if path[1] <= T:
    print(path[0])
    flag=True
    break
if not flag:
  print('TLE')

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

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

c = []
t = []

for i in range(N):
    c.append(ct[i][0])
    t.append(ct[i][1])

minc = 10000

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

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

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

Solution (Python):
import sys

def main():
  input = sys.stdin.readline
  N, T = map(int, input().split())
  C = 1010
  for _ in range(N):
    c, t = map(int, input().split())
    if t > T:
      continue
    else:
      C = min(C, c)
  
  if C == 1010:
    print('TLE')
  else:
    print(C)


if __name__ == '__main__':
  main()

Solution (Python):
class Solver(object):
    def __init__(self):
        self.n, self.t = list(map(int, input().split(" ")))

    def solve(self):
        min_cost = 1001
        for _ in range(self.n):
            c, t = list(map(int, input().split(" ")))
            if t <= self.t:
                if c < min_cost:
                    min_cost = c
            min_cost
        if min_cost < 1001:
            print(min_cost)
        else:
            print("TLE")


if __name__ == "__main__":
    s = Solver()
    s.solve()

Solution (Python):
n,t=list(map(int,input().split(" ")))
list_ct=[]
list_ctT=[]
for count in range(n):
    list_ct.append(list(map(int,input().split(" "))))

for count in range(n):
    if list_ct[count][1]<=t:
        list_ctT.append(list_ct[count][0])
    else:
        pass
if list_ctT!=[]:
    print(min(list_ctT))
else:
    print("TLE")

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

X.sort(key=lambda x:x[1])
if X[0][1]>t:
    print('TLE')
else:
    Y=[i for i in X if i[1]<=t]
    Y.sort(key=lambda x:x[0])
    print(Y[0][0])

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

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

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

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

Solution (Python):
cost = list()
p = [int(i) for i in input().split()]
for j in range(p[0]):
    ipt = [int(i) for i in input().split()]
    if p[1]>=ipt[1]:
        cost.append(ipt[0])
if cost==list():
    print('TLE')
else:
    print(min(cost))

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

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

Solution (Python):
N,T = list(map(int, input().split()))
CT = [list(map(int,input().split())) for i in range(N)]
CT.sort()
res = float('inf')
for c,t in CT:
    if t <= T:
        res = min(res,c)

print(res if res!=float('inf') else 'TLE')

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

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

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

Solution (Python):























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

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

ans_c = 9999
ans = None
for ind, (c, t) in enumerate(zip(cs, ts)):
    if c<ans_c and t<=Time:
        ans_c = c
        ans = ind

if ans is None:
    print("TLE")
else:
    print(ans_c)

Solution (Python):
n,t=map(int,input().split())
A=[]
for _ in range(n):
    cost,time=map(int,input().split())
    A.append([cost,time])
mincost=float('inf')
for i in range(n):
    if A[i][1]<=t:
        mincost=min(mincost,A[i][0])
if mincost==float('inf'):
    print('TLE')
else:
    print(mincost)

Solution (Python):
def inpl(): return list(map(int, input().split()))
N, T = inpl()
ans = 10000
for i in range(N):
    c,t = inpl()
    if t > T:
        continue
    ans = min(ans, c)
if ans == 10000:
    print('TLE')
else:
    print(ans)

Solution (Python):



from sys import stdin

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

h=[]
for i in range (N):
    h.append( map(int, stdin.readline().split()) )

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

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

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

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

Solution (Python):
import numpy as np

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

c_min = np.inf
for p in pl:
    if p[1] <= T:
        if p[0] <= c_min:
            c_min = p[0]

if c_min == np.inf:
    print("TLE")
else:
    print(c_min)

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

for i in ct_list:
    if i[1] > t:
        continue
    if ans > i[0]:
        ans = i[0]

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

Solution (Python):
nt=[int(x) for x in input().split()]
mini=1001
try:
    for y in range(nt[0]):
        temp=([int(z) for z in input().split()])
        if(temp[1]<=nt[1] and temp[0]<mini):
            mini=temp[0]
            ans=mini
    print(ans)
except:
    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)
  
min_cost = 10**4
for i in range(N):
  if t[i]<=T and min_cost>c[i]:
    min_cost=c[i]

if min_cost==10**4:
  print("TLE")
else:
  print(int(min_cost))

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 not C:
    print('TLE')
else:
    print(min(C))

Solution (Python):
ntlist = list(map(int, input().split()))
n,t = ntlist[0], ntlist[1]

c = 10**10
for i in range(n):
    inputlist = list(map(int, input().split()))
    if inputlist[1] <= t:
        if inputlist[0] <= c:
            c = inputlist[0]
print(c) if c != 10**10 else print('TLE')

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

if(cmin <= 1000):
    print(cmin)
else:
    print("TLE")

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

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

min = 1001
for i in range(n):
    a,b = map(int,input().split())
    if b <= t:
        if a < min:
            min = a

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

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

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

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

Solution (Python):
N,T=map(int, input().split())
ans=9999
for i in range(N):
  A,B=map(int, input().split())
  if (T>=B):
    if(ans>=A):
      ans=A
if(ans==9999):
  print("TLE")
else:
  print(ans)

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

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

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

t_cost=[T - li[i][1] for i in range(N)]

if(all(x < 0 for x in t_cost)):
  print('TLE')
else:
  t_cost_1=[]
  for i in range(N):
    if(t_cost[i]>=0):
      t_cost_1.append(i)
    else:continue
  
  print(min([li[t_cost_1[i]][0] for i in range(len(t_cost_1))]))

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

t_cost=[T - li[i][1] for i in range(N)]

if(all(x < 0 for x in t_cost)):
  print('TLE')
else:
  t_cost_1=[]
  for i in range(N):
    if(t_cost[i]>=0):
      t_cost_1.append(i)
    else:continue
  
  print(min([li[t_cost_1[i]][0] for i in range(len(t_cost_1))]))

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

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

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

else:
    print(result)

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

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

min=2000

for i in range(0,N):
  c,t=map(int,input().split(" "))
  if t>T:
    continue
  else:
    min=min-(min-c)*(c<min)

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

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

O = 1001
for i in range(Keiro):
    tmpC,tmpT = map(int,input().split())
    if(tmpT <= T and tmpC < O):
        O = tmpC


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

Solution (Python):


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

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

    print(str(min_c) if min_c != 9999 else 'TLE')


if __name__ == '__main__':
    main()

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

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

tmp_min = 10**5

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

if tmp_min == 10**5:
    print('TLE')
else:
    print(int(tmp_min))

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

tmp_min = float('inf')

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

if tmp_min == float('inf'):
    print('TLE')
else:
    print(int(tmp_min))

Solution (Python):
N, T = input().split()
N, T = int(N), int(T)
R = [input().split() for i in range(N)]
 
for i, r in enumerate(R):
  R[i] = [int(r[0]), int(r[1])]
 
R_sorted = sorted(R, key = lambda x: x[0])
 
List = []
answer = 'TLE'
 
for r in R_sorted:
  if r[1] <= T:
    List.append(r[0])

if List:
  answer = min(List)

print(answer)

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

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

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

Solution (Python):
N, T = map(int, input().split())
data = [list(map(int, input().split())) for _ in [0]*N]
data.sort(key=lambda x: x[0])
data = [d for d in data if d[1] <= T]
print(data[0][0] if len(data) >= 1 else 'TLE')

Solution (Python):
N,T=list(map(int,input().split()))
a=[]
cost=9999
for i in range(N):
    a.append(list(map(int,input().split())))
    if a[i][0]<cost and a[i][1]<=T:
        cost=a[i][0]
        minnum=i
if cost == 9999:
    print("TLE")
else:
    print(cost)

Solution (Python):
""" AtCoder """

import sys
input = sys.stdin.readline

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

min_c = 1001

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

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

Solution (Python):
a, b = map(int, input().split())
l = []
for _ in range(a):
  x, y = map(int, input().split())
  if y <= b:
    l.append(x)
if l == []:
  print('TLE')
else:
  print(min(l))

Solution (Python):
def main():
    n, t = map(int, input().split())
    ans = 100000000
    for i in range(n):
        c, tt = map(int, input().split())
        if tt <= t:
            ans = min(ans, c)
    if ans >= 1000000:
        print('TLE')
    else:
        print(ans)
    
if __name__ == '__main__':
    main()

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

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

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

mincost = 10000
for i in range(n):
  if c[i][1] <= t:
    cost = c[i][0]
    mincost=min(cost,mincost)

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

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

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

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

Solution (Python):


def main():
    n, t = map(int, input().split())
    cts = []
    for i in range(n):
        ci, ti = map(int, input().split())
        cts.append((ci, ti))
    cts = [ct for ct in cts if ct[1] <= t]
    if len(cts) == 0:
        print("TLE")
    else:
        cts.sort(key=lambda ct: ct[0])
        print(cts[0][0])

main()

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

cost = 1001

for i in li:
    if t >= i[1]:
        if cost > i[0]:
            cost = i[0]

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

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

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

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

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

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

for i in range(n):
    c,s = map(int,input().split())
    if s <= t:
        d.append(c)
if d== []:
    print("TLE")
else:
    print(min(d))

Solution (Python):
N,T = map(int,input().split())
ct = [list(map(int,input().split())) for _ in range(N)]
ok = False
cost = 10**10
for i in range(N):
    if ct[i][1] <= T and cost > ct[i][0]:
        cost = ct[i][0]
        ok = True
print(cost if ok else 'TLE')

Solution (Python):
def main():
    N, T = map(int, input().split())
    m = 1001
    for _ in range(N):
        c, t = map(int, input().split())
        if T >= t and m > c:
            m = c
    if m == 1001:
        print('TLE')
    else:
        print(m)


if __name__ == '__main__':
    main()

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