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

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

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

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

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

ans = 'TLE'
for ci, ti in ct:
    if ti > T: continue
    
    if ans == 'TLE':
        ans = ci
    else:
        ans = min(ans, ci)

print(ans)

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

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N, T = MAP()
ct = [LIST() for _ in range(N)]
ct.sort(key=lambda x:(x[0], x[1]))
for c, t in ct:
    if t <= T:
        print(c)
        break
else:
    print("TLE")

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

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

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

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

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

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

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

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

Solution (Python):
N,T=map(int,input().split())
c_t=[]
mincos=1001
for c,t in zip(range(N),range(N)):
    c,t=map(int,input().split())
    if t<=T:
        if c<mincos:
            mincos=c

print("TLE" if mincos>1000 else mincos)

Solution (Python):
n, s = map(int, input().split())
c = [0 for i in range(n)]
t = [0 for i in range(n)]
for i in range(n):
    c[i], t[i] = map(int, input().split())
mi = 1001
ans = 0
for i in range(n):
    if s >= t[i] and mi > c[i]:
        mi = c[i]
        ans = c[i]
if ans == 0:
    print("TLE")
else:
    print(ans)

Solution (Python):


def solve():

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

    ct = []

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

    ans = 1001

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

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


if __name__ == "__main__":
    solve()

Solution (Python):
def main():
    N, T = map(int, input().split())
    ans = 10000
    for _ 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,tt=map(int,input().split())
c=[0]*n
t=[0]*n
ans=1001
for i in range(n):
  c[i],t[i]=map(int,input().split())
  if (t[i]<=tt):
    ans=min(ans,c[i])
    
print(ans if (ans<1001) else "TLE")

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

for i in range(N):
    if l[i][1]<=T:
        if l[i][0]<=c_min:
            c_min=l[i][0]
    
    if l[i][1]<=t_min:
        t_min=l[i][1]
    
if t_min > T:
    print("TLE")
else:
    print(c_min)

Solution (Python):

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

min_cost = 9999

for _ in range(N):
    c, t = [int(s) for s in input().split()]
    min_cost = min(min_cost, c) if t <= T else min_cost

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

Solution (Python):
def main():
    N, T = map(int, input().split())
    path = [[int(a) for a in input().split()] for i in range(N) ]
    minc = 10000
    for [c, t] in path:
        if t <= T :
            if minc > c:
                minc = c
    if minc == 10000:
        print("TLE")
    else:
        print(minc)
main()

Solution (Python):


n,m=map(int, input().split())
k = 1001
for i in range(n):
    p,j = map(int, input().split())
    if j<=m:k=min(k,p)
print("TLE" if k == 1001 else k)

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

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

ans = 10**9
flg = False
for i in range(n):
    c, t = map(int, input().split())
    if T >= t:
        flg = True
        ans = min(ans, c)
if flg: print(ans)
else: print('TLE')

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

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

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

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

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

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

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

if __name__ == '__main__':
    solve()

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


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

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

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

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

ct_1 = sorted(ct, key=lambda h: (h[0], h[1]))
ct_2 = sorted(ct, key=lambda h: (h[1], h[0]))

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

if ct_2[0][1]>T:
    print('TLE')

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

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

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

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

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

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

if len(ans) == 0:
    print("TLE")
else:
    ans.sort()
    print(ans[0])

Solution (Python):
N,T,*L=map(int,open(0).read().split())
print(min([1111]+[c for c,t in zip(*[iter(L)]*2)if t<=T])%1111or"TLE")

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

CT=[[0,0]]*N
i=0
while i<N:
    CT[i]=list(map(int,input().split()))
    i+=1

CT=sorted(CT)

ans='TLE'
for x,y in CT:
    if y<=T:
        ans=x
        break
print(ans)

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

for i in range(n):
    c, t = map(int, input().split())
    cost.append(c)
    time.append(t)

for c, t in zip(cost, time):
    if t <= T:
        element.append(c)

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

Solution (Python):
MOD = 10 ** 9 + 7
INF = 10 ** 10
import sys
sys.setrecursionlimit(100000000)
dy = (-1,0,1,0)
dx = (0,1,0,-1)

def main():
    n,T = map(int,input().split())
    ans = INF
    for _ in range(n):
        c,t = map(int,input().split())
        if t <= T:
            ans = min(ans,c)
    
    if ans == INF:
        print('TLE')
    else:
        print(ans)
if __name__ =='__main__':
    main()

Solution (Python):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin, log, log10
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
def debug(*args):
    if debugmode:
        print(*args)
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def FLOAT(): return float(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7
dx = [0, 0, 1, -1, 1, -1, -1, 1]
dy = [1, -1, 0, 0, 1, -1, 1, -1]
debugmode = True

n, t = MAP()
ans = inf
for _ in range(n):
    c, tt = MAP()
    if tt <= t:
        ans = min(ans, c)
if ans == inf:
    ans = 'TLE'
print(ans)

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

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

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

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

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

Solution (Python):
def Time_Limit_Exceeded(n , t , ctl):

    ans = 0
    count = []

    for i in ctl:
        if i[1] <= t:
            count.append(i[0])

    return min(count) if len(count) != 0 else "TLE"

def main():
    n , t = map(int , input().split())
    ctl = [list(map(int , input().split())) for i in range(n)]
    print(Time_Limit_Exceeded(n , t , ctl))

if __name__ == '__main__':
    main()

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

d=[]
for i in range(n):
    w=c[i]
    if c[i][1]<=t:
        d.append(w)

if not d:
    print("TLE")
else:
    print(d[0][0])

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

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

cost=[]

for i in range(n):
    c,time=[int(i) for i in input().split()]
    if time<=limit:
        cost.append(c)
cost.sort()

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

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

Solution (Python):
line = input()
a, b = [int(n) for n in line.split()]
tempo = b
custo = 1001
tle = True
for n in range(1, a+1):
    line = input()
    c, t = [int(n) for n in line.split()]
    if t<=tempo and c<=custo:
        custo = c
        tle = False

print(custo if tle==False else "TLE")

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



lowest=1000

if min(ti)>T:
  print('TLE')
else:
  for i in range(N):
    if ti[i]<=T and ci[i]<=lowest:
      lowest=ci[i]
  print(lowest)

Solution (Python):
n, T = map(int, input().split())
out = list()
for _ in range(n):
    c, t = map(int, input().split())
    if t > T: continue
    out.append((c, t))
print(min(out)[0]) if out and min(out)[1] <= T else print("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)
if ans == 2000:
  print('TLE')
else:
  print(ans)

Solution (Python):
p,q= input().split()
a,b =(int(p), int(q))
ans_list = []
for i in range(a):
    c = input().split()
    if int(c[1]) <= b:
        ans_list.append(int(c[0]))

if len(ans_list) is not 0:
    print(min(ans_list))
else:
    print('TLE')

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

'''aux=[input().split() for _ in range(N)]
aux.sort()'''

c, aux=[], []
for i in range(N):
	x, y=map(int, input().split())
	
	if(y<=T):
		aux=[[int(x), int(y)]]	
		c.extend(aux)
			

if (len(c)==0):
	print("TLE")
else:
	aux=min(c)
	print(aux[0])

Solution (Python):
linha = input()
Nvezes,TempoMax = [int(n) for n in linha.split()]
listaCusto = []
listaTempo = []
minimo = 1001
for aux in range(Nvezes):
    entrada = input()
    custo,tempo = [int(n) for n in entrada.split()]
    listaCusto.append(custo)
    listaTempo.append(tempo)
indiceMenor = listaCusto.index(min(listaCusto))



if listaTempo[indiceMenor] <= TempoMax:
    print(min(listaCusto))
elif listaTempo[indiceMenor] > TempoMax:
    for posicao, elemento in enumerate(listaCusto):
        if listaCusto[posicao] < minimo and listaTempo[posicao] <= TempoMax:
            minimo = listaCusto[posicao]
    if minimo == 1001:
         print("TLE")
    else:
        print(minimo)

Solution (Python):
line = input()
n, t = [int(n) for n in line.split()]
min_coust = 0
route = 0
for _ in range(n):
    line = input()
    coust, time = [int(n) for n in line.split()]
    if min_coust == 0 and time <= t:
        min_coust = coust
    elif time <= t and coust <= min_coust:
        min_coust = coust
ans = "TLE" if min_coust== 0 else min_coust
print(ans)

Solution (Python):
fline = input()
it, max_time = [int(n) for n in fline.split()]


cost_time = []
for i in range(it):
    line = input()
    c, t = [int(n) for n in line.split()]
    pair = (c, t)
    cost_time.append(pair)

cost_time.sort(key=lambda x: x[1])
cost_time2 = []
for i in range(it):
    tupl = cost_time[i]
    if(tupl[1]<=max_time):
        cost_time2.append(cost_time[i])

cost_time2.sort(key=lambda x: x[0])
if(len(cost_time2)==0):
    print('TLE')
else:
    el = cost_time2[0]
    print(el[0])

Solution (Python):
a, b = map(int, input().split())
menor_t, menor_c = 1000, 1000
index = 0
for i in range(a):
    c, t = map(int, input().split())
    if t <= b:
        if c < menor_c:
            menor_c = c
        index = i + 1
if index == 0:
    print('TLE')
else:
    print(menor_c)

Solution (Python):
line = input()
N, T = [int(n) for n in line.split()]
lst = []
for i in range(N):
	cost, time = list(map(int, input().split()))
	if time <= T:
		lst.append(cost)
print('TLE' if len(lst) == 0 else min(lst))

Solution (Python):
line = input()
X, Y = [int(n) for n in line.split()]

value = "TLE"
route_cost = []
for _ in range(X):
    line = input()
    cost, time = [int(n) for n in line.split()]
    route_cost.append([cost, time])

route_cost.sort(key=lambda x: x[0])
for cost, time in route_cost:
    if time > Y:
        continue
    else:
        value = cost
        break
print(value)

Solution (Python):
x = input()
k=x.split(" ")
N = int(k[0])
T = int(k[1])


c = []
t = []

for i in range(N):
    p = input()
    y = p.split(" ")
    if int(y[1]) <= T:
        c.append(int(y[0]))
        t.append(int(y[1]))

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

Solution (Python):
def main():
    line = input()
    n, T = [int(x) for x in line.split()]
    lista_tempos = []
    lista_custos = []
    for i in range(n):
        line = input()
        c, t = [int(x) for x in line.split()]
        if t <= T:
            lista_tempos.append(t)
            lista_custos.append(c)
    if lista_tempos:
        print(min(lista_custos))
    else:
        print('TLE')
main()

Solution (Python):
n, t = map(int, input().split())
rotas = list()
for _ in range(n):
    n1, t1 = map(int, input().split())
    if t1 <= t:
        rotas.append(n1)
if rotas:
    print(min(rotas))
else:
    print("TLE")

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

Solution (Python):
N, T = map(int, input().split())
keiro = []
for _ in range(N):
    C, time = map(int, input().split())
    if time <= T:
        keiro.append(C)
keiro.sort()
if len(keiro)>0:
    print(keiro[0])
else:
    print("TLE")

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

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

res = 10000
for i in range(n):
  if List[i][1] <= t:
    res = min(res, List[i][0])
if res == 10000:
  print("TLE")
else:
  print(res)

Solution (Python):
import sys

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

for i in sorted(d):
    if i[1] <= T:
        print(i[0])
        sys.exit()
else:
    print('TLE')

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

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

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

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):
from functools import reduce
from fractions import gcd
import math
import bisect
import itertools
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline
INF = float("inf")


def main():
    N, T = map(int, input().split())
    
    res = INF
    for _ in range(N):
        c, t = map(int, input().split())
        if t <= T:
            res = min(res, c)
    
    if res == INF:
        print("TLE")
    else:
        print(res)

if __name__ == '__main__':
    main()

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

Solution (Python):

N, T = map(int, input().split())
ans = 1001
for _ in range(N):
    ci, ti = map(int, input().split())
    if ti <= T:
        ans = min(ans, ci)
        
if ans == 1001:
    print("TLE")
else:
    print(ans)

Solution (Python):


import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n,T = LI()
ct = [LI() for _ in range(n)]
ct.sort()
for c,t in ct:
    if t <= T:
        print(c)
        quit()
print('TLE')

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

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

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

Solution (Python):










"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""
 
def main():
  n,t = map(int,input().split())
  mi_ = float("inf")
  change = False
  for _ in range(n):
    c,t_ = map(int,input().split())
    if t_ <= t:
      mi_ = min(mi_,c)
      change = True
  if change:
    print(mi_)
  else:
    print('TLE')
  
if __name__ == '__main__':
  main()

Solution (Python):
N, T = map(int, input().split())
ans = 10000
for _ in range(N):
    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())
ct= [list(map(int, input().split())) for _ in range(n)]
ct1=[]
for i in range(n):
    if ct[i][1]<=t:ct1.append(ct[i])
if len(ct1)==0:print('TLE')
else:print(min(ct1[j][0] for j in range(len(ct1))))

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

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

ans = 10000

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

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

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

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

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

resolve()

Solution (Python):
N, T = map(int, input().split())
ct=[]
for _ in range(N):
    ct.append(tuple(map(int, input().split())))
OK=[tpl for tpl in ct if tpl[1]<=T]
if OK:
    good=min(OK, key=lambda x:x[0])
    print(good[0])
else:
    print('TLE')

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

res = 1001
for c, t in ct:
    if t <= T:
        res = min(res, c)
if res != 1001:
    print(res)
else:
    print("TLE")

Solution (Python):
a=list(map(int,input().split()))
b=[]
c=10000
for i in range(a[0]):
    b.append(list(map(int,input().split())))
for j in range(a[0]):
    if b[j][1]<=a[1] and c>b[j][0]:
        c=b[j][0]
if c!=10000:
    print(c)
else:
    print("TLE")

Solution (Python):
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n,T = iim()
cost = 1001
for i in range(n):
    c,t = iim()
    if t <= T:
        cost = min(cost,c)
if cost == 1001:
    print('TLE')
else:
    print(cost)

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

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

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

res = 1001
for c, t in ct:
    if t <= T:
        res = min(res, c)
if res != 1001:
    print(res)
else:
    print("TLE")

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

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

cost = 1001
count = 0
for i in range(N):
    if lists[i][1] <= T:
        count += 1
        if i == 0:
            cost = lists[i][0]
        elif cost >= lists[i][0]:
            cost = lists[i][0]
        else:
            continue
    else:
        continue
if count == 0:
    print("TLE")
else:
    print(cost)

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

Solution (Python):
N, T = map(int,input().split())
cntn = [list(map(int,input().split())) for _ in range(N)]
cost = pow(10,10)
for n in range(N):
  if cntn[n][1] <= T: cost = min(cost,cntn[n][0])
print("TLE" if cost == pow(10,10) else cost)

Solution (Python):
N, T = map(int, input().split())
ans = 1e9
for n 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):
import sys

n,t=map(int,input().split())
be=1001
count=0
for _ in range(n):
  c,time=map(int,input().split())
  if time<=t and c<=be:
    count+=1
    be=c
  if _==n-1 and count==0:
    print("TLE")
    sys.exit()
    
print(be)

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

cost = 1001
count = 0
for i in range(N):
    if lists[i][1] <= T:
        count += 1
        if i == 0:
            cost = lists[i][0]
        elif cost >= lists[i][0]:
            cost = lists[i][0]
        else:
            continue
    else:
        continue
if count == 0:
    print("TLE")
else:
    print(cost)

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

cost = 1001
count = 0
for i in range(N):
    if lists[i][1] <= T:
        count += 1
        if i == 0:
            cost = lists[i][0]
        elif cost >= lists[i][0]:
            cost = lists[i][0]
        else:
            continue
    else:
        continue
if count == 0:
    print("TLE")
else:
    print(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)
print('TLE' if m==1001 else m)

Solution (Python):

def inputlist(): return [int(j) for j in input().split()]


N,T = inputlist()
ans = 10**9
for i in range(N):
    c,t = inputlist()
    if t <= T:
        ans = min(ans,c)
if ans == 10**9:
    ans = 'TLE'
print(ans)

Solution (Python):
import sys
from bisect import *
from heapq import *
from collections import *
from itertools import *
from functools import *
from math import *
from fractions import *

sys.setrecursionlimit(100000000)
input = lambda: sys.stdin.readline().rstrip()


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

main()

Solution (Python):
N,T = map(int,(input().split()))
c = [[0]*2 for _ in range(N)]
ans = []
for i in range(N):
    c[i][0],c[i][1] = map(int,(input().split()))
    if c[i][1] <= T:
        ans.append(c[i][0])
if ans:
    ans.sort()
    print(ans[0])
else:
    print("TLE")

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

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

ct = sorted(ct)
for c, t in ct:
    if t<=T:
        print(c)
        exit()

print('TLE')

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

ans = []

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

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

result = 1001
for i in range(n):
    c,t = list(map(int,input().split()))
    if t <= limit and c < result:
        result = c

print(result if result < 1001 else 'TLE')