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())
inf = 100000000000000
ans = inf
for i in range(n):
    a,b = map(int,input().split())
    if b <= t:
        if ans > a:
            ans = a

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

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

min_cost=1001
for i in range(n):
  cost,time=list(map(int,input().split()))
  if time <= t:
    min_cost=min(min_cost,cost)
print([min_cost,'TLE'][1000<min_cost])

Solution (Python):
n, tx = map(int, input().split())
ans = 1100
for i in range(n):
    c, t = map(int, input().split())
    if (t <= tx):
        ans = min(ans, c)
print(ans if ans != 1100 else 'TLE')

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

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

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

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

z = sorted(ct, key=lambda x: (x[0],x[1]))
for i in range(n):
    if z[i][1] <= t:
        print(z[i][0])
        exit()
print("TLE")

Solution (Python):
n,t = map(int, input().split())
lower_cost = 1001
for i in range(n):
    c,m = map(int, input().split())
    if m <= t:
        if c < lower_cost:
            lower_cost = c
print(lower_cost if not lower_cost==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().split())
c_list = []
t_list = []

for i in range(n):
    c1, t1 = map(int, input().split())
    c_list.append(c1)
    t_list.append(t1)

ans = 0
for i in range(n):
    if ans == 0:
        if t_list[i] <= t:
            ans = c_list[i]
    else:
        if t_list[i] <= t and c_list[i] < ans:
            ans = c_list[i]

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

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

list1=[]
for i in range(N):
    X,Y=map(int,list[i].split(" "))
    if Y <= T:
        list1.append(X)
print(min(list1) if list1 != [] 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):
import math
import copy
import sys

inputa = input().split()



a = int(inputa[0])
b = int(inputa[1])








inputList=[]
inputNumList = []
for i in range(a):
    inputNum = input().split()
    inputNumList = [int(n) for n in inputNum]
    inputList.append(inputNumList)






for i in range(a-1, -1, -1):
    if b < inputList[i][1]:
        del inputList[i]

if len(inputList) == 0:
    print("TLE")
else:
    sortedInputList = sorted(inputList, key=lambda n:n[0])
    print(sortedInputList[0][0])

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

c=1001
for i in range(n):
    ck,tk=input().split()
    if int(tk)<=t and int(ck)<c:
        c=int(ck)
        
if c==1001:
    print("TLE")
else:
    print(c)

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

Solution (Python):

n, t = [int(x) for x in input().split()]
ct = [list(map(int,input().split())) for x in range(n)]
target = list(x[0] for x in filter(lambda x:x[1] <= t,ct))
print('TLE' if len(target) == 0 else min(target))

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

min_c = 1001

for _ in range(N):
    _c, _t = map(int, input().split())

    if _t <= T:
        min_c = min(min_c, _c)

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

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

c = []
t = []
for _ in range(N):
    _c, _t = map(int, input().split())

    if _t <= T:
        c.append(_c)
        t.append(_t)

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

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

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

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

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

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

Solution (Python):
n, t = map(int, input().split())
c = 10000
for i in range(n):
    ce, te = map(int, input().split())
    if te <= t:
        if ce < c:
            c = ce
if c == 10000:
    print('TLE')
else:
    print(c)

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

Solution (Python):
n, t = map(int, input().split())
ct = [list(map(int, input().split())) for _ in range(n)]
ans = 2000
flag = False
for i in ct:
    if i[1] <= t and ans >= i[0]:
        ans = i[0]
        flag = True

if flag:
    print(ans)
else:
    print("TLE")

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

ans = 10000000000

for j in range(N):
    if y[j] <= T:
        if ans > x[j]:
            ans = x[j]

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

else:
    print(ans)

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

Solution (Python):

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

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

Solution (Python):
n,t=map(int,input().split())
cost_list=[]
for i in range(n):
  cost,time=map(int,input().split())
  if time<=t:
    cost_list+=[cost]
if cost_list!=[]:
  print(min(cost_list))
else:
  print("TLE")

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

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

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

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

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

if ans >1000:
    print("TLE")
else:
    print(ans)

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

minc = 100000000
for ct in CT:
    if ct[1] > T: continue
    newc = ct[0]
    if newc < minc: minc = newc

if minc == 100000000: print('TLE')
else: print(minc)

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

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

keiro_sorted = sorted(keiro, key=lambda x: x[1])

if keiro_sorted[0][1] > T:
    print("TLE")
    exit()
ans = 1000
for i in range(N):
    if keiro_sorted[i][1] > T:
        break
    ans = min(keiro_sorted[i][0], ans)

print(ans)

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

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

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

Solution (Python):
n, t = map(int, input().split())
minidx = 1001
for i in range(n):
    n_, t_ = map(int, input().split())
    if t_<=t:
        minidx = min(minidx, n_)
print("TLE" if minidx>1000 else minidx)

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

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

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

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

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

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

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

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

ans = 1001
for _ in range(N):
    c, t = [int(x) for x in input().split()]
    if t <= T and c < ans:
        ans = c
if ans == 1001:
    print('TLE')
else:
    print(ans)

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

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

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

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

t1 = []
r1 = 1001

for i1 in range(n1):
    t1 = [int(j) for j in input().split()]
    if t1[1] <= n2:
        if t1[0] < r1:
            r1 = t1[0]

if r1 == 1001:
    r1 = "TLE"
print(r1)

Solution (Python):
n,t = map(int,input().split())
ma = 1001
for i in range(n):
    c,ti = map(int,input().split())
    if ti < t+1:
        if c< ma: ma=c
print(ma if ma !=1001 else"TLE")

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

routes = []
cost = 1000

for i in range(n):
    array = list(map(int, input().split()))
    if array[1] <= t:
        routes.append(array)
        cost = min(array[0], cost)

if not routes:
    print('TLE')
    exit()

print(cost)

Solution (Python):
N,T = map(int, input().split())
C = [list(map(int,input().split())) for i in range(N)]
X = sorted(C, key = lambda x:x[1])

i = 0
ans = 1001
while X[i][1] <= T:
  ans = min(ans, X[i][0])
  if i + 1 == N:
    break
  i += 1

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

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

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

for i in range(N):
    if c[i][1] <= T:
        ans.append(c[i])

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

try:
    print(ans[0][0])
except:
    print('TLE')

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 and ans > c:
        ans = c
if ans != float('inf'):
    print(ans)
else:
    print('TLE')

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

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

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

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

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

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

for i in range(n):
    cl[i],tl[i]=map(int,input().split())
    
min_cost = 100000
for i in range(n):
    if cl[i] < min_cost and tl[i] <= t:
        min_cost = cl[i]
if min_cost < 100000:
    print(min_cost)
else:
    print("TLE")

Solution (Python):
n, t = map(int, input().split())
mc = 10 ** 9
for i in range(n):
    c1, t1 = map(int, input().split())
    if t1 <= t:
        mc = min(mc, c1)
if mc == 10 ** 9:
    print("TLE")
else:
    print(mc)

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

min_c = 1001
for (c, time) in routes:
    if time <= t:
        min_c = min(min_c, c)
if min_c == 1001:
    min_c = "TLE"
print(min_c)

Solution (Python):
N, T = (int(i) for i in input().split())
c_min = 114514

for i in range(N):
	c, t = (int(i) for i in input().split())
	if t <= T:
		c_min = min(c_min, c)
if c_min == 114514:
	print("TLE")
else:
	print(c_min)

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

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

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

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

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

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

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

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

Solution (Python):

import sys
input = sys.stdin.readline

def main():
    n, t = tuple(map(int, input().rstrip().split()))
    data = tuple(tuple(map(int, input().rstrip().split())) for _ in range(n))
    match = {i[0] for i in data if i[1] <= t}
    if match == set():
        print("TLE")
    else:
        print(min(match))


if __name__ == "__main__":
    main()

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

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

cost= 1111
for cti in ct:
  if cti[1]<=t:
    if cti[0] < cost:
      cost=cti[0]

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

Solution (Python):
Tmp = []
Tmp = input().rstrip().split(' ')
 
nN = int(Tmp[0])
nT = int(Tmp[1])
 
nCost = 1001
nAns = 0
 
for i in range(nN):
  Tmp = input().rstrip().split(' ')
 
  nTmpCost = int(Tmp[0])
  nTmpT = int(Tmp[1])
  
  if nTmpT <= nT and nTmpCost < nCost:
    nCost = nTmpCost
    nAns = i+1

if nAns == 0:
  print('TLE')
else:
  print(nCost)

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

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

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

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



min_cost = 10000
flag = False

for ct in ct_list:
  c = ct[0]
  t = ct[1]
  
  
  if t <= T:
    if c <= min_cost:
      min_cost = c
      flag = True
    
      
if flag:     
  print(min_cost)
else:
  print("TLE")

Solution (Python):


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

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

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("TLE")
else:
    print(min)

Solution (Python):
n, t = map(int, input().split())
_list = [input() for i in range(n)]
costs, times = [], []
for elem in _list:
    
    cost, time = map(int, elem.split())
    costs.append(cost)
    times.append(time)

min_cost = 1001  
for cost, time in zip(costs, times):
    if time <= t and cost < min_cost:
        min_cost = cost  

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

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

for i in range(n):
    c,t1=map(int,input().split())
    if t1 <= t:
        if c < an:
            an=c

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

Solution (Python):
n,t=map(int,input().split())
s=set([1001])
for i in range(n):
    ci,ti=map(int,input().split())
    if ti<=t:
        s.add(ci)
print(min(s) if min(s)<=1000 else "TLE")

Solution (Python):
n, t = list(map(int, input().split()))
data = []
for i in range(n):
    data.append(list(map(int, input().split())))
minCost = 1001
for i in range(n):
    if data[i][1] <= t and minCost > data[i][0]:
        minCost = data[i][0]

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

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

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

Solution (Python):
n,t = map(int,input().split())
l=[]
cc=99999
for i in range(n):
   c,tt = map(int,input().split())
   if tt<=t:
       if c<cc:
           cc=c
if cc==99999:
    print("TLE")
else:
    print(cc)

Solution (Python):
n,t,*l=map(int,open(0).read().split())
c=3e9
for i,j in zip(l[::2],l[1::2]):
	if j<=t:
		c=min(c,i)
print(c*(c<3e9)or"TLE")

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

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

root=[]

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

print(min(root) if len(root)>0 else 'TLE')

Solution (Python):
import sys
from collections import deque

sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(N, T, inputs):
    routes = list(map(string_to_int, inputs))
    min_cost = -1
    for r in routes:
        if r[1] <= T and (min_cost == -1 or r[0] < min_cost):
            min_cost = r[0]
    if min_cost == -1:
        return "TLE"
    return str(min_cost)


def string_to_int(string):
    return list(map(int, string.split()))


if __name__ == "__main__":
    [N, T] = string_to_int(input())
    ret = solve(N, T, inputs(N))
    print(ret)

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

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

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

def main():
	n, T = map(int, input().strip().split())
	s = [0] * n
	ans = 10**9
	for i in range(n):
		c, t = map(int, input().strip().split())
		if t <= T and c < ans:
			ans = c
	if ans == 10**9:
		print('TLE')
	else:
		print(ans)

if __name__ == '__main__':
	main()

Solution (Python):
NT = list(map(int, input().split(' ')))
N = NT[0]
T = NT[1]
res = []
for _ in range(N):
    nt = list(map(int, input().split(' ')))
    n = nt[0]
    t = nt[1]
    if t <= T:
        res.append(n)
if not res:
    res = 'TLE'
else:
    res = min(res)
print(res)

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)
if cost == float("inf"):
    print("TLE")
else:
    print(cost)

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

print(min(C) if C else 'TLE')

Solution (Python):
n,t = map(int,input().split())
a = []
cnt = 0
for i in range(n):
  cost,time = map(int,input().split())
  if time<= t:
    cnt +=1
    a.append(cost)
  else:
    pass
if cnt > 0:
  print(min(a))
else:
  print("TLE")

Solution (Python):
import copy

def main():

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

    ans=min((i if j <= T else TLE for i,j in targetList))
    print(ans) if ans != TLE else print("TLE")

if __name__== "__main__":
    main()

Solution (Python):
import sys
import numpy as np

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

ct = np.zeros([2,N])

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

ct = ct[:,np.argsort(ct[0,:])]

for i in range(N):
    if ct[1,i] <= T:
        print(int(ct[0,i]))
        sys.exit()

print('TLE')

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

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

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

for i in list1:
  if int(i[1]) <= t:
    list2.append(i)

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

Solution (Python):

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

res=None

for _ in range(n):
    c,u=map(int,input().split())
    if u <= t:
        res = min(res,c) if res else c

print(res if res else "TLE")

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

ans = 'TLE'

for i in lst:
  if (i[1] <= T):
    if (ans == 'TLE'):
      ans = i[0]
    else:
      if (i[0] < ans):
        ans = i[0]
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:
     if c<=ans:
        ans=c
if ans==10000:
  print('TLE')
else:
  print(ans)

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

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

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:
            ans = min(ans, c)
    if ans == float("Inf"):
        print("TLE")
    else:
        print(ans)


if __name__ == "__main__":
    main()

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

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


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

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

Solution (Python):
n, t = map(int, input().split())
l = []
for _ in range(n):
    c, ti = map(int, input().split())
    l.append((c, ti))
least_cost = None
for j in l:
    if j[1] <= t and (least_cost == None or j[0] < least_cost):
        least_cost = j[0]
if least_cost == None:
    print('TLE')
else:
    print(least_cost)

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

ok_list = []
for j in range(N):
    if List[j][1] <= T:
        ok_list.append(List[j][0])
if ok_list == []:
    print("TLE")
else:
    ok_list.sort()
    print(ok_list[0])

Solution (Python):
n,T = map(int, input().split())
ans = float('inf')
flag = True
for i in range(n):
    c,t = map(int, input().split())
    if t <= T and c <= ans:
        ans = c
        flag = False
if flag:
    print("TLE")
else:
    print(ans)

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

ans = 1001

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

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

Solution (Python):
n,t=map(int,input().split())
info=[0]
for i in range(n):
    info.append(list(map(int,input().split())))
ans="TLE"
cost=10000
for i in range(1,n+1):
    if info[i][1]<=t and info[i][0]<cost:
        cost=info[i][0]
        ans=str(cost)
print(ans)

Solution (Python):



N, T = map(int, input().split())
a1 = [list(map(int, input().split())) for i in range(N)]
a2 = list(filter(lambda i: i[1] <= T, a1))
if a2 == []:
    print("TLE")
else:
    print(a2[(a2.index(min(a2)))][0])

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:
  C.sort()
  print(C[0])

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

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

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

Solution (Python):
n,t = map(int,input().split())
routes = [list(map(int,input().split())) for _ in range(n)]
routes2 = list(filter(lambda x: x[1]<=t,routes))
routes3 = sorted(routes2,key=lambda x: x[0])
if len(routes3) == 0:print("TLE")
else:print(routes3[0][0])

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

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

cst=[]

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

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

Solution (Python):

from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')


def A():
    n = II()
    if n == 1:
        print("Hello World")
    else:
        print(II()+II())
    return


def B():
    n, t = LI()
    ans = inf
    for i in range(n):
        c, ti = LI()
        if ti <= t:
            ans = min(ans, c)
    if ans == inf:
        print("TLE")
        return
    print(ans)
    return


def C():
    n = II()
    xyh = LIR(n)
    xyh.sort(key = lambda x:x[2], reverse = True)
    x1, y1, h1 = xyh[0]
    del xyh[0]
    for x in range(101):
        for y in range(101):
            h = abs(x - x1) + abs(y - y1) + h1
            flg = True
            for xn, yn, hn in xyh:
                if max(h - abs(x - xn) - abs(y - yn), 0) == hn:
                    continue
                flg = False
                break
            if flg:
                print(x, y, h)
                return 
    return


def D():
    n, m = LI()
    ans = 1
    for i in range(1,int(math.sqrt(m)+1)):
        if m % i == 0:
            a = m // i
            
            if a * n <= m:
                ans = max(ans, a)
            if i * n <= m:
                ans = max(ans, i)
    print(ans)
    return


if __name__ == '__main__':
    B()

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

c_t = filter(lambda ct: ct[1] <= T, c_t)
c_t = sorted(c_t, key=lambda ct: ct[0])
if len(c_t) > 0:
    c, t = c_t[0]
    print(c)
else:
    print('TLE')

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

res = []
for x, y in zip(c, t):
    if y <= T:
        res.append(x)
if len(res) > 0:
    print(min(res))
else:
    print("TLE")

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

ans = 1001
tmp = 1001

for i in range(N):
    ansT, tmpT = map(int, input().split())
    if T >= tmpT:
        ans = min(ans, ansT)

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

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