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_limit = (int(x) for x in input().split())
cost_list = list()
time_list = list()
while n >= 1:
    c,tn = (int(x) for x in input().split())
    if tn <= t_limit:
        cost_list.append(c)
        time_list.append(tn)
        n = n - 1
    else:
        n = n - 1
if not time_list:
    print('TLE')
else:
    best_cost = min(cost_list)
    print(best_cost)

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

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

if len(c) == 0:
    print('TLE')
    exit()
elif len(c) == 1:
    print(int(c[0]))
    exit()
elif len(c) >= 2:
    ans = int(c[0])
    for i in range(len(c)-1):
        if ans > int(c[i+1]):
            ans = int(c[i+1])
print(ans)

Solution (Python):
if __name__ == "__main__":
    N, T = map(int,input().split(' '))
    c = []
    t = []
    for i in range(N):
        c1, t1 = [int(i) for i in input().split(' ')]
        c.append(c1)
        t.append(t1)

    min = "None"
    for i in range(N):
        if T >= t[i]:
            if min == "None":
                min = c[i]
            else:
                if min > c[i]:
                    min = c[i]
    if min == "None":
        print("TLE")
    else:
        print(min)

Solution (Python):
import numpy as np

dataNum, timeMax = input().strip().split(' ')
dataNum, timeMax = [int(dataNum), int(timeMax)]

cost = [10000]
time = [10000]

"""
for i in range(dataNum):
    A, B = list(map(int, input().strip().split(' ')))   
    cost.append(A)
    time.append(B)

if min(time) > timeMax:
    print('TLE')
else :
    print(min(cost))
"""
for i in range(dataNum):
    A, B = list(map(int, input().strip().split(' ')))   
    if B <= timeMax:
        cost.append(A)
        time.append(B)
    
if min(time) > timeMax:
    print('TLE')
else :
    print(min(cost))

Solution (Python):
N, T = map(int, input().split())
dic = {}
for i in range(0,N):
    cost, time = map(int, input().split())
    dic[cost] = time
result = 1001
for cost, time in dic.items():
    if time <=T :
        if result >= cost:
            result = cost
if result == 1001:
    print("TLE")
else:
    print(result)

Solution (Python):


def main():
	N, T = map(int,input().split())
	c_list = []
	t_list = []
	for i in range(N):
		c, t = map(int,input().split())
		c_list.append(c)
		t_list.append(t)
	
	
	
	index_list = []
	for i in range(len(t_list)):
		if t_list[i] <= T:
			index_list.append(i)
	
	
	
	if len(index_list) == 0:
		return print("TLE")

	cost_min = float("inf")
	for i in index_list:
		if c_list[i] < cost_min:
			cost_min = c_list[i]
	
	print(int(cost_min))
	

if __name__ == "__main__":
	main()

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

mic=1001
for i in range(n):
    if A[i][1]<=t :
        mic=min(mic,A[i][0])

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

Solution (Python):


from operator import itemgetter

n, t = map(int, raw_input().split())
ans = 0
i=0

l = [[0 for i in range(2)] for j in range(n)]



for i in range(0, n):
    a, b = map(int, raw_input().split())
    l[i][0] = a
    l[i][1] = b
    

l.sort(key=itemgetter(1))


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

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

listA=[] 
for i in range(N):
    a,b=input().split()
    listA.append([int(a), int(b)])

for i in range(len(listA)):
    if(T<listA[i][1]):
        listA[i][0]=9999

minc=9999
index=9999
for i in range(len(listA)):
    if(minc>listA[i][0]):
        minc=listA[i][0]
        index=i
if(minc==9999):
    print('TLE')
    exit(0)
print(minc)

Solution (Python):
"""
N, M = map(int, input().split( ))
a = []
for i in range(2):
    a.append(map(int, input().split( )))
print (a) 




"""

result = 1001
A = input().split()
N = int(A[0])
T = int(A[1])
e =[]
e = [[i for i in input().split()] for i in range(N)] 

for i in range(N):
    if int(e[i][1]) <= T:
        temp = int(e[i][0])
        if result >int(e[i][0]): 
            result = int(e[i][0])

if result ==1001:
    result ="TLE"

print(result)

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

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

TLE=0

for j in range(N):
    if TT[j]>T:
        TLE= TLE+1
    else:
        pass
    
if TLE==N:
    print("TLE")

else:   
    ans=max(C)

    for k in range(N):
        if TT[k]>T:
            pass
        elif C[k]<ans:
            ans=C[k]

    print(ans)

Solution (Python):
import numpy as np

N, T = input().split()
N = int(N)
T = int(T)
c = np.zeros(N)
t = np.zeros(N)
for i in range(N):
    cc, tt = input().split()
    c[i] = int(cc)
    t[i] = int(tt)
if (t < T).sum() > 0:
    n = np.min(c[t <= T])
    print(int(n))
else:
    print("TLE")

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

Solution (Python):
import numpy as np
N,T = map(int, input().split())

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

c_list = np.array(c_list)
t_list = np.array(t_list)	

if not np.any(t_list[t_list<=T]):
	print('TLE')
else:
	print(min(c_list[t_list<=T]))

Solution (Python):



def solve(t, paths):
    return min((p for p in paths if p[1] <= t), default=(None, None))[0]


def main():
    n, t = (int(z) for z in input().split())
    paths = (tuple(int(ct) for ct in input().split()) for _ in range(n))
    res = solve(t, paths)
    print("TLE" if res is None else res)


if __name__ == '__main__':
    main()

Solution (Python):
n,t = map(int,input().split())
lis = [list(map(int, input().split())) for _ in range(n)]
minCost = float("inf")
cnt = 0
for i in lis:
    if i[1] <= t:
        if i[0] < minCost:
            minCost = i[0]
            cnt += 1
if cnt != 0:  
    print(minCost)
else:
    print('TLE')

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

best=-1
best_c=-1
for _ in range(N):
    c,t = map(int,input().split())
    if t <= T:
        if best_c == -1:
            best_c = c
        elif best_c > c:
            best_c = c
if best_c == -1:
    print("TLE")
else: 
    print(best_c)

Solution (Python):
N,T=map(int,input().split())
flag=1001
for _ in range(N):
    c,t=map(int,input().split())
    if t>T:
        continue
    else:
        count=c
        if count<=flag:
            flag=count

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

Solution (Python):


array = list(map(int, input().strip().split(' ')))


N =  array[0]

T =  array[1]





if N < 1:
    sys.exit()

if N > 100:
    sys.exit()


if T < 1:
    sys.exit()

if T > 1000:
    sys.exit()



c_min = 9999


for i in range(N):
    array1 = list(map(int, input().strip().split(' ')))
    cN =  array1[0]

    tN =  array1[1]

    if cN < 1:
        sys.exit()

    if cN > 1000:
        sys.exit()

    if tN < 1:
        sys.exit()

    if tN > 1000:
        sys.exit()
    
    if tN <= T:
        if c_min > cN:

            c_min = cN

if c_min == 9999:
    print("TLE")

else:
    print(c_min)

Solution (Python):
def main():
    N,T= (int(i) for i in input().split())
    a_min=1001

    for i in range(N):
        ai,bi= (int(j) for j in input().split())  
        if bi<= T:
            if ai <= a_min:
                a_min = ai

    if a_min==1001:
        print("TLE")
    else:
        print(a_min)
          
     
main()

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

Solution (Python):
n,s=map(int,input().split())
listc=[]
listt=[]
for i in range(n):
    c,t=map(int,input().split())
    listc.append(c)
    listt.append(t)
import copy
listct=copy.copy(listt)
for t in listct:
    if t>s:
        listc.pop(listt.index(t))
        listt.pop(listt.index(t))
if len(listt)==0:
    print('TLE')
else:
    print(min(listc))

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

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

Solution (Python):
n, T = map(int, input().split())
a = set()
min_ = 1001
for i in range(n):
    c, t = map(int, input().split())
    a.add(c)
    if t <= T and c < min_:
        min_ = c
    a.remove(c)
if min_ == 1001:
    print('TLE')
else:
    print(min_)

Solution (Python):

N, T = map(int, input().split())
CMINMAX = 10000 
cmin = CMINMAX
for n in range(N):
    c, t = map(int, input().split())
    if(t <= T):
        if(c < cmin):
            cmin = c

if(cmin == CMINMAX):
    print("TLE")
else:
    print(cmin)

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

ct = []
for i in range(N):
    ct_input = input()
    ct.append(ct_input)
    

flag = True
cost = 1000
for i in range(N):
    cti = ct[i]
    cti = cti.split()
    ci = int(cti[0])
    ti = int(cti[1])
    if T < ti:
        continue
    if cost >= ci:
        cost = ci
        flag = False



if flag == True:
    print("TLE")
else:
    print(cost)

Solution (Python):

N,T=input().split(' ')
N=int(N)
T=int(T)
a=list()
for i in range(N):
    c,t=input().split(' ')
    c=int(c)
    t=int(t)
    a.append((c,t))

minValue=0x3FF

for it in a:
    if it[1]>T:
        continue
    if it[0]<minValue:
        minValue=it[0]
if(minValue==0x3FF):
    print("TLE")
else:
    print(minValue)

Solution (Python):


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

cNtN = [[0] * 2 for i in range(N)]
for i in range(N):
    cNtN[i][0], cNtN[i][1] = map(int, input().split())

for i in range(N):
    if cNtN[i][1] > T:
        cNtN[i][0] = float('inf')

min_c = float('inf')
for i in range(len(cNtN)):
    min_c = min(min_c, cNtN[i][0])

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

Solution (Python):

import sys
from collections import deque
import copy

def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline


def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N, T] = [int(input_raw[0]), int(input_raw[1])]
    min_cost = sys.maxint
    for i in range(N):
        input_raw = read_func().strip().split()
        [c, t] = [int(input_raw[0]), int(input_raw[1])]
        if t <= T:
            min_cost = min(min_cost, c)
    if min_cost < sys.maxint:
        print min_cost
    else:
        print "TLE"

if __name__ == '__main__':
    main()

Solution (Python):
NT_in = input()
NT = NT_in.split()
N = int(NT[0])
T = int(NT[1])
d = {}
for i in range(N):
	str_num = input()
	num = str_num.split()
	d[int(num[0])] = int(num[1])
for c, t in sorted(d.items(), key=lambda x: x[0]):
	if t <= T:
		print(c)
		break
else:
	print("TLE")

Solution (Python):
nt = input().split()
ct = [0]
for i in range(int(nt[0])):
    inp = input().split()
    if int(inp[1]) <= int(nt[1]):
        ct.append(int(inp[0]))
ct.sort()
if len(ct) == 1:
    print("TLE")
else:
    print(ct[1])

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

x = 0
num = 1
costs = []

while num <= n:
    cost, time = list(map(int, input().split()))
    num += 1
    if TIME - time >= 0:
        costs.append(cost)

if len(costs) != 0:
    output = min(costs)
else:
    output = "TLE"
print(output)

Solution (Python):
import sys
a=input()
c=a.split(" ")
c[0]=int(c[0])
c[1]=int(c[1])
b=[input().split(" ") for x in range(c[0])]

for i in range(len(b)):
    for x in range(2):
        b[i][x]=int(b[i][x])



b.sort(key=lambda x:x[1])


if c[1] < b[0][1]:
    print("TLE")
    sys.exit()

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

mini=10000000000
for i in range(len(b)):
    if b[i][1] <= c[1]:
        if b[i][0] <= mini:
            mini=i
print(b[mini][0])

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

x = [[int(i) for i in input().split()] for i in range(N)]

m = x[0][0]

for i in range(N):
	if x[i][1]<T+1:
		m = min(m,x[i][0])
t=x[0][1]

for i in range(N):
	t=min(t,x[i][1])

if t<T+1:
	print(m)
else:
	print("TLE")

Solution (Python):
N,T = map(int,input().split())
L = list(tuple(map(int,input().split())) for _ in range(N))
print(min((c for c,t in L if t <= T), default='TLE'))

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

clist = []
tlist = []

for _ in range(N):
  L = list(map(int,input().split(' ')))
  clist.append(L[0])
  tlist.append(L[1])
  
List = [c for c,t in zip(clist,tlist) if t<=T]

if len(List):
  print(min(List))
else:
  print('TLE')

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

hit = False
cur_cheapest = 1000

for n in range(N):
    c, t = map(lambda x: int(x), input().split(' '))
    if t > T:
        continue
    hit = True
    if c < cur_cheapest:
        cur_cheapest = c

if hit is False:
    print('TLE')
else:
    print(cur_cheapest)

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


n = n_list[0]
TIME = n_list[1]

x = 0
num = 1
costs = []

while num <= n:
    cost, time = list(map(int, input().split()))
    num += 1
    if TIME - time >= 0:
        costs.append(cost)

if len(costs) != 0:
    output = min(costs)
else:
    output = "TLE"
print(output)

Solution (Python):
a = input().split()
n = 1001
for i in range(int(a[0])):
    b = input().split()
    if int(b[0]) < n and int(b[1]) <= int(a[1]):
        n = int(b[0])

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

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

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

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

Solution (Python):
ans = 1000
ans_f = 0
a,b = map(int,input().split())
for i in range(a):
    c,d = map(int,input().split())
    if d <= b:
        ans_f = 1
        if c < ans:
            ans = c
if ans_f == 1:
    print(ans)
else:
    print('TLE')

Solution (Python):
import sys
N, M = map(int, raw_input().split())
a = []
b=[]
res=1000
flag=0
for i in sys.stdin:
    b=i.split()
    b[0]=int(b[0])
    b[1]=int(b[1])
    if M >=b[1] and res >=b[0]:
        res=b[0]
        flag=1

if flag==1:
    print res
else:
    print "TLE"

Solution (Python):
import sys

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

min_cost = 99999999999
for line in sys.stdin.readlines():
    c, t = line.strip().split()
    c = int(c)
    t = int(t)
    if t <= T:
        if c < min_cost:
            min_cost = c

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

Solution (Python):


N, T = [int(i) for i in input().split()]
keiros = []
for i in range(N):
	c, t = [int(j) for j in input().split()]
	if t <= T:
		keiros.append(c)
if not keiros:
	print("TLE")
else:
	print(min(keiros))

Solution (Python):



import sys

input = raw_input().split(" ")
N = int(input[0])
T = int(input[1])

c = []
t = []


for i in range(0, N):
    ct = raw_input().split(" ")
    c.append(int(ct[0]))
    t.append(int(ct[1]))

for i in range(0, len(c)):
    mincost = min(c)
    minindex = c.index(mincost)

    if t[minindex] <= T:
        print mincost
        sys.exit()
    else:
        c.pop(minindex)
        t.pop(minindex)
        if len(c) == 0:
            print 'TLE'
        continue

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

c_min = 1001
for w in way:
    if w[1] <= t_limit:
        if c_min > w[0]:
            c_min = w[0]

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

Solution (Python):
num,limit=input().strip().split(' ')


costs=[]
for i in range(int(num)):
    cost, time = input().strip().split(' ')
    if (int(time) > int(limit)):
        continue
    else:
        costs.append(int(cost))
if costs:
    print(min(costs))
else:
    print('TLE')

Solution (Python):
import numpy as np

dat0 = input().split()
N = int(dat0[0])
T = int(dat0[1])

dat1 = [input().split() for i in range(N)]

dat = np.array(dat1)
dat = dat.astype(np.int64)



lt_T = dat.T[1] <= T

ans = dat.T[0][lt_T]

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

Solution (Python):
N,T = map(int, input().split())
grid = []
ans = 100000
for i in range(N):
    array = list(map(int, input().strip().split(' ')))
    if array[1] <= T:
      ans = min(ans,array[0])
if ans == 100000:
  print('TLE')
else:
  print(ans)

Solution (Python):
pair = []

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

for i in range(0,N):
    c,t = map(int, input().split())
    pair.append((c,t))

ans = (1001,1001)
for tup in pair:
    if tup[1] <= T:
        if ans[0] > tup[0]:
            ans = tup

if ans[0] == 1001:
    print('TLE')
else:
    print(ans[0])

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

cost = 1001
for i in range(N):
    c,t = [int(i_r) for i_r in input().split()]
    if t <= T and c < cost:
        cost = c

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

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

Solution (Python):
n, T = [int(x) for x in input().split()]
cost = 2000

for _ in range(n):
  c, t = [int(x) for x in input().split()]
  if t <= T:
  	cost = min(cost, c)

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

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

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

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

Solution (Python):
n,t=map(int,input().split())
result=1001
for i in range(n):
    ci,ti=map(int,input().split())
    if ti > t:
        pass
    else:
        result=min(result,ci)
if result==1001:
    print('TLE')
else:
    print(result)

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

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

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

for i in range(N):
    
    if ans>a[i][0] and T>=a[i][1]:
        ans=a[i][0]
if ans<10000:
    print ans
else:
    print "TLE"

Solution (Python):
N,T=list(map(int,input().split()))
cost_list=[]
time_list=[]
for i in range(N):
    c,t=list(map(int,input().split()))
    cost_list.append(c)
    time_list.append(t)
while 1:
    min_cost=min(cost_list)
    min_index=cost_list.index(min_cost)
    if time_list[min_index]<=T:
        print(min_cost)
        break
    else:
        del time_list[min_index]
        del cost_list[min_index]
        if cost_list==[]:
            print("TLE")
            break

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

c_list = []
t_list = []
min_c = 1000
n_append = 0
argmin_c = None
for _ in range(n):
    c_i, t_i = map(int, input().split())
    
    if t_i <= t:
        c_list.append(c_i)
        t_list.append(t_i)
        n_append += 1
        if min_c >= c_i:
            min_c = c_i
            argmin_c = len(c_list) - 1 

if n_append > 0:
    print(c_list[argmin_c])
else:
    print("TLE")

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

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

pc = 1001
for i in range(n):
    cc,ct = (int(_) for _ in input().split())
    if (ct <= t and cc < pc):
        pc = cc

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

Solution (Python):
N, T = list(map(int, input().split()))
ans = -1
for i in range(N):
    c, t = list(map(int, input().split()))
    if t<=T:
        if ans==-1:
            ans = c
        elif c<ans:
            ans = c 

if ans==-1:
    print('TLE')
else:
    print(ans)

Solution (Python):
n,t = map(int, input().split())
cc = 10000
for i in range(n):
    ci, ti = map(int, input().split())
    if ti <= t:
        if ci <= cc:
            cc = ci
if cc > 1000:
    print('TLE')
else:
    print(cc)

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

Solution (Python):
N, T = map(int, input().split())
result_cost = 0
for n in range(N):
    c, t = map(int, input().split())
    if t <= T:
        if result_cost == 0:
            result_cost = c
        if c < result_cost:
            result_cost = c
print('TLE' if result_cost == 0 else result_cost)

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

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

if T < min(t):
  print('TLE')

else:
  Answer = 1000
  for i in range(N):
    if t[i] <= T and c[i] <= Answer:
      Answer = c[i]
  print(Answer)

Solution (Python):


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

c = [i for i in range(N)]
t = [i for i in range(N)]

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

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

if a == 9999:
    print('TLE')
else:
    print(a)

Solution (Python):
N, T = [int(i) for i in input().split()]
ans = 1500
for i in range(N):
    c1, c2 = [int(j) for j in input().split()]

    if c2 <= T:
        ans = min(c1,ans)

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

Solution (Python):
N,T=map(int,input().split())
c=[None]*N
t=[None]*N
okCost=[None]*N
for i in range(N):
    c[i],t[i]=map(int,input().split())
    if t[i]<=T:
      okCost[i]=c[i]
okCost=[x for x in okCost if x is not None]
if okCost==[]:
    print("TLE")
else:
    print(min(okCost))

Solution (Python):
import bisect


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

pairs = []
for i in range(N):
	_c, _t = map(int, raw_input().split())
	pair = [_c, _t]
	pairs.append(pair)

pairs = sorted(pairs, key=lambda x:x[1])
idx = bisect.bisect_right([i[1] for i in pairs], T)
res = sorted(pairs[:idx], key=lambda x:x[0])
if res == []:
	print "TLE"
else:
	print res[0][0]

Solution (Python):
n,t=map(int,input().split())
m=10000
for i in range(n):
  a,b=map(int,input().split())
  if b>t: continue
  m = min(m, a)
print(m if m!=10000 else 'TLE')

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

Solution (Python):

from operator import itemgetter


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

ct = []
for i in range(n):
    c_0,t_0 = map(int, input().split())
    ct.append([c_0,t_0])

time_flag = 0
for i in range(len(ct)):
    if ct[i][1] <= t:
        time_flag += 1
    else:
        ct[i][0] = 1001

ct0=list(ct)
ct.sort(key=itemgetter(0))


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

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

Solution (Python):
import collections
import sys
import numpy as np
from operator import itemgetter

N, T = map(int, input().split())
c = [0]*N
t = [0]*N
ct = [[0, 0]]*N

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

ct.sort(key=itemgetter(0), reverse=False)
for i in range(N):
    if ct[i][1] <= T:
        print(ct[i][0])
        sys.exit()
print("TLE")

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

tmp = [input().split() for i in range(n)]
c = 1001
for i in range(n):
  
  ctmp, ttmp = tmp[i]
  if int(ttmp) <= t and int(ctmp) < c:
    c = int(ctmp)
    
if c == 1001:
  print("TLE")
else:
  print(c)

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

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

Solution (Python):
N,T  = map(int,input().split())
AnsC = 9999
for item in range(N):
    C = input().split()
    if int(C[1]) <= T:
        AnsC = min(AnsC,int(C[0]))
        


if AnsC >= 1001:
    print ("TLE")
else:
    print(AnsC)

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

carr = []
carr2 = []
tarr = []

for i in range(N):
    c, t = map(int, input().split())
    carr.append(c)
    tarr.append(t)

for y in range(N):
    if tarr[y] <= T:
        carr2.append(carr[y])

if carr2 ==[]:
    print('TLE')
else:
    print(min(carr2))

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

cost_list = []

for i in range(len(list)):
    if list[i][1] <= T:
        cost_list.append(list[i][0])

if len(cost_list) >= 1:
    print(min(cost_list))
elif len(cost_list) == 0:
    print('TLE')

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

lf = list(filter(lambda x: x[1] <= T, l))

if(len(lf) == 0):
    print('TLE')
else:
    ls = sorted(lf, key=lambda x: x[0])
    print(ls[0][0])

Solution (Python):
route_num, limit = map(int, input().split(' '))

costs = []
spends = []
for i in range(route_num):
    cost, spend = map(int, input().split(' '))
    costs.append(cost)
    spends.append(spend)

min_cost = 2000
for cost, spend in zip(costs, spends):
    if spend <= limit and cost < min_cost:
        min_cost = cost

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

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

for _ in range(n):
    a,b = map(int,input().split())
    if b <= t:
        less.append(a)

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

Solution (Python):
N, T = map(int, raw_input().split(' '))
C = 1001

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

Solution (Python):
import numpy as np


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

s = np.array([])

for i in range(N):
    s = np.append(s, np.array(list(map(int, input().split()))))

s = s.reshape((N, 2))

pos = np.where(s[:, 1] <= T)

if pos[0].shape == (0,):
    print('TLE')
else:
    print(int(np.sort(s[pos], axis=0)[0][0]))

Solution (Python):



inp = input().split(' ')
N = int(inp[0])
T = int(inp[1])
flag = False
ans_cost = 1001

for i in range(N):
    inp = input().split(' ')
    c = int(inp[0])
    t = int(inp[1])
    
    if t <= T:
        if ans_cost >= c:
            flag = True
            ans_cost = c

if flag == True:
    print(ans_cost)
else:
    print('TLE')

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

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

idx = 0
minc = 1001

while idx < n:
    rc, rt = map(int, input().split())
    if rt <= l_time:
        if rc < minc:
          minc = rc
    idx = idx + 1

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

Solution (Python):
a=input().split()
min=1001
for i in range(int(a[0])):
    aa=input().split()
    if int(aa[1])<=int(a[1]) and int(aa[0])<min:
        min=int(aa[0])
if min==1001:
    print("TLE")
else:
    print(min)

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


ret = 10**10

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

if ret == 10**10:
    ret = "TLE"

print(ret)

Solution (Python):
import numpy as np
n, T = map(int, input().split())
array = np.zeros((0, 2))

for i in range(n):
    

    array = np.r_[array, np.array(list(map(int, input().split()))).reshape(-1, 2)]

idx = np.argsort(array[:, 0])
array = array[idx]
result = 'TLE'
for c, t in array:
    if t <= T:
        result = int(c)
        break
    

print(result)

Solution (Python):
nt = []
nt = list(map(int, input().split()))

grid = []
for i in range(nt[0]):
    array = list(map(int, input().strip().split(' ')))
    grid.append(array)

c = 1001
for pair in grid:
    if pair[1] <= nt[1]:
        if pair[0] < c:
            c = pair[0]

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

Solution (Python):

from sys import stdin

N, T = [int(x) for x in stdin.readline().rstrip().split()]
keiro = [[0] * 2 for i in range(N)]
keiro = []
check = 0

for i in range(N):
    c, t = [int(x) for x in stdin.readline().rstrip().split()]
    if t <= T:
        keiro.append([c,t])

if keiro == []:
    print("TLE")
    exit()

keiro_s = sorted(keiro)

print(keiro_s[0][0])

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

flag = False
for i in range(N):
    if t[i] <= T:
        flag = True

if flag == False:
    print("TLE")

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

if flag == True:
    print(min)

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

L.sort()
while(len(L) > 0 and L[0][1] > T):
    L.pop(0)
if L.__len__() == 0:
    print("TLE")
else:
    print(L[0][0])