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 = input().split()
N = [int(n) for n in N]

c = 1001
for i in range(N[0]):
    
    data = input().split()
    data = [int(n) for n in data]
    if(data[1]<=N[1]):
        if(data[0] < c):
            c = data[0]

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

Solution (Python):
n,t = map(int,input().split(' '))
cost = float('inf')
num = 0
for i in range(n):
    nc,nt = map(int,input().split(' '))
    
    if t >= nt and nc < cost:
        cost = nc
    
if cost == float('inf'):
    print('TLE',end='')    
else:
    print(cost,end='')

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

Solution (Python):
N, T = [int(i) for i in input().split()]
R = [input().split() for i in range(N)]
Clist = [int(i[0]) for i in R if int(i[1]) <= T]
C = 'TLE' if Clist == [] else sorted(Clist)[0]
print(C)

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

lc = []

for i in range(N):
  c, it = map(int, input().split())
  if it<= T:
    lc.append(c)
    
if len(lc) == 0:
  print("TLE")
else:
  print(min(lc))

Solution (Python):
n, t = map(int, raw_input().split())
cm = 1000
f = 0
for i in range(n):
    ci, ti = map(int, raw_input().split())
    if ti <= t:
        f = 1
        if ci <= cm:
            cm = ci
if f == 0:
    print "TLE"
else:
    print cm

Solution (Python):

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

ret_cost = 1001
ret_time = 1001

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

if ret_time > T:
	print('TLE')
else :
	print(ret_cost)

Solution (Python):
Input = input()
li = Input.split(" ")
NT = list(map(int,li))
N = NT[0]
T = NT[1]
i = 1
mi = 9999

while i <= N:
    Input = input()
    li = Input.split(" ")
    a = list(map(int,li))
    c = a[0]
    t = a[1]
    if t <= T and c < mi:
        mi = c
    i += 1

if mi == 9999:
    print("TLE")
else:
    print(mi)

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

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

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


if __name__ == '__main__':
    main()

Solution (Python):
a,b = map(int,input().split())
li = []
for i in range(a):
    c,d = map(int,input().split())
    if b >= d:
        if li != []:
            if li[0] > c:li = [c,d]
        else:li = [c,d]
if li == []:print("TLE")
else:print(li[0])

Solution (Python):
a,b = map(int,input().split())

li = []

for i,n in enumerate(range(a)):
    c,d = map(int,input().split())
    if b >= d:
        if li != []:
            if li[0] > c:
                li = [c,d]
        else:
            li = [c,d]

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

Solution (Python):

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

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

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

Solution (Python):
n, t = map(int, input().split(" "))
ct = [list(map(int, input().split(" "))) for _ in range(n)]
valid = [_ct for _ct in ct if _ct[-1] <= t]
if len(valid) > 0:
    print(sorted(valid, key=lambda x: x[0])[0][0])
else:
    print("TLE")

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

if len(distArray)>1:
    tmp=distArray[1][0]
    for num in range(2,len(distArray)):     
        
        if distArray[num][0]<tmp:   
            tmp=distArray[num][0]       

    print(tmp)
else:        
    print("TLE")

Solution (Python):
N , T  = map(int,input().split())
result = 1001
while N > 0:
 a,b = map(int,input().split())
 if b <= T and a < result:
  result = a
 N = N - 1
if result == 1001:
 print('TLE')
else:
 print(result)

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

for i in range(N):
    cost, time = map(int, input().split())

    if time <= T:
        min_cost = min(cost, min_cost)

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

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

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

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

Solution (Python):
A = list(map(int,input().split()))
N = A[0]
T = A[1]
ans = 999999
for i in range(0,N):
  A = list(map(int,input().split()))
  if T >= A[1]:
    ans = (A[0] if ans > A[0] else ans)
print(ans if ans != 999999 else "TLE")

Solution (Python):
import sys
import math
import collections
import itertools
import array
import inspect


sys.setrecursionlimit(1000000)



def chkprint(*args):
    names = {
        id(v): k
        for k, v in inspect.currentframe().f_back.f_locals.items()
    }
    print(', '.join(
        names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args))



def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in input().split()]


def gcd(n, m):
    if n % m == 0:
        return m
    else:
        return gcd(m, n % m)


def gcd_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = gcd(v, L[i])

    return v


def lcm(n, m):
    return (n * m) // gcd(n, m)


def lcm_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = lcm(v, L[i])

    return v



def wfs_d(D, N, K):
    """
    D: 隣接行列(距離付き)
    N: ノード数
    K: 始点ノード
    """

    dfk = [-1] * (N + 1)
    dfk[K] = 0

    cps = [(K, 0)]
    r = [False] * (N + 1)
    r[K] = True
    while len(cps) != 0:
        n_cps = []
        for cp, cd in cps:
            for i, dfcp in enumerate(D[cp]):
                if dfcp != -1 and not r[i]:
                    dfk[i] = cd + dfcp
                    n_cps.append((i, cd + dfcp))
                    r[i] = True

        cps = n_cps[:]

    return dfk



def dfs_d(v, pre, dist):
    """
    v:  現在のノード
    pre: １つ前のノード
    dist: 現在の距離

    以下は別途用意する
    D: 隣接リスト(行列ではない)
    D_dfs_d: dfs_d関数で用いる，始点ノードから見た距離リスト
    """

    global D
    global D_dfs_d

    D_dfs_d[v] = dist

    for next_v, d in D[v]:
        if next_v != pre:
            dfs_d(next_v, v, dist + d)

    return


def sigma(N):
    ans = 0
    for i in range(1, N + 1):
        ans += i
    return ans


def comb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2, r + 1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p - 1, r, p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def bisearch(L, target):
    low = 0
    high = len(L) - 1
    
    while low <= high:
        mid = (low + high) // 2
        guess = L[mid]
        if guess == target:
            return True
        elif guess < target:
            low = mid + 1
        elif guess > target:
            high = mid - 1
    if guess != target:
        return False



dp = None


def main():
    N, T = li_input()
    A = []

    for i in range(N):
        A.append(li_input())

    ans = 9999999999999999999

    for a in A:
        c, t = a

        if t <= T and c < ans:
            ans = c

    if ans != 9999999999999999999:
        print(ans)
    else:
        print("TLE")


main()

Solution (Python):


INITIAL_COST = 1001

def main():

    
    costs = []
    times = []

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

    for i in range(N):
        c, t = map(int, input("").split())
        costs.append(c)
        times.append(t)

    
    routes = dict(zip(costs, times))

    current_cost = INITIAL_COST
    for c, t in routes.items():
        if t <= T and c < current_cost:
            current_cost = c

    if current_cost == INITIAL_COST:
        print("TLE")
    else:
        print(current_cost)


if __name__ == "__main__": main()

Solution (Python):
d = list(map(int,(input().strip().split(' '))))
N = d[0]
T = d[1]
min = 100000000
for i in range(0, N):
    d = list(map(int,input().strip().split(' ')))
    c = d[0]
    t = d[1]
    if t <= T:
        if min >= c:
            min = c
if min == 100000000:
    print("TLE")
else:
    print(min)

Solution (Python):
N, T = map(int, input().split())
i = 0
min_cost = 1000
fg = False
while i < N:
    i += 1
    c, t = map(int, input().split())
    if t <= T:
        if c <= min_cost:
            fg = True
            min_cost = c

if fg:
    print(min_cost)
else:
    print('TLE')

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

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

Solution (Python):
import math

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

c_list = []
for i in range(N):
    c1, t1=[int(i) for i in input().split()]
    if t1 <= T:
        c_list.append(c1)

if not c_list:
    print('TLE')
else:
    print(min(c_list))

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

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

cost_min = max(ct[:,0])
ans = "TLE"
for ct0 in ct:
    cost_i = ct0[0]
    time_i = ct0[1]
    if time_i <= T:
        if cost_i <= cost_min:
            cost_min = cost_i
            ans = cost_min

print(ans)

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


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

print('TLE')

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

c = 1001
for i in range(n):
    if e[i][1] <= t:
        c = min(c, e[i][0])
if c <= 1000:
    print(str(c))
else:
    print('TLE')

Solution (Python):


n,T = map(int,raw_input().split())
c = []
t = []
for i in range(n):
    c_new, t_new = map(int,raw_input().split())
    c.append(c_new)
    t.append(t_new)

a = []
for i in range(n):
    if t[i] <= T: a.append(i)

c_min = 10000
for i in a:
    if c[i] < c_min: c_min = c[i] 

if c_min > 1000:
    print "TLE"
else:
    print c_min

Solution (Python):
def main():
    N, T = (int(x) for x in input().split())
    c=None
    for i in range(N):
        c_tmp, t_tmp = (int(x) for x in input().split())
        if t_tmp<=T:
            if c is None or c_tmp<c:
                c=c_tmp

    if c is None:
        print('TLE')
    else:
        print(c)

if __name__ == '__main__':
    main()

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

Solution (Python):
import sys


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

    ans = 10**5

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

    if ans == 10**5:
        print('TLE')
        return

    print(ans)


if __name__ == '__main__':
    main()

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

list = []
for i in range(0, N):
    c, t = [int(x) for x in input().split()]
    list.append((c, t))

filteredList = [x for x in list if x[1] <= T]



if len(filteredList) >= 1:
    res = min(filteredList, key=lambda x: x[0])
    print(res[0])
else:
    print("TLE")

Solution (Python):

TLE_COST = 1010

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

cost = TLE_COST
for _ in range(N):
    c, t = [int(s) for s in input().strip().split()]
    if t <= T and c < cost:
        cost = c

if cost != TLE_COST:
    print(cost)
else:
    print("TLE")

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




answer = 10000

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

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

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

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

a = []

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

min = 9999

for i in a:
    if i[1] <= t and i[0] < min:
        min = i[0]

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

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

cost = 100001
for i in range(N):
    ci, ti = map(int, input().split())
    if ti <= T:
        if cost > ci:
            cost = ci
if cost != 100001:
    print(cost)
else:
    print('TLE')

Solution (Python):
def calc(N, T, c, y):
    cost = 1001
    for i in range(N):
        if T >= y[i] and cost > c[i]:
            cost = c[i]
    return cost


def main():
    N, T = list(map(int, input().split()))
    c, y = [], []
    for _ in range(N):
        ct = list(map(int, input().split()))
        c.append(ct[0])
        y.append(ct[1])
    ret = calc(N, T, c, y)
    print([ret,"TLE"][ret==1001])


if __name__ == "__main__":
    main()

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

ans = "TLE"

for i in range(n):
    cc, tt = map(int, input().split())
    if tt <= t:
        if ans == 'TLE':
            ans = cc
        else:
            ans = min(ans, cc)

print(ans)

Solution (Python):

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

c_list = []
t_list = []

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

n_min = 1001

for i, j in zip(c_list, t_list):
    if j <= t and i < n_min:
        n_min = i

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

Solution (Python):



def main():
    n, t = map(int, input().split())
    clist = []
    for _ in range(n):
        c, tt = map(int, input().split())
        if tt <= t:
            clist.append(c)

    if not clist:
        print('TLE')
    else:
        print(min(clist))


if __name__ == '__main__':
    main()

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

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

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

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

Solution (Python):
n,s = map(int,input().split())
f = 0
m = 1001
for _ in [0]*n:
  c,t = map(int,input().split())
  if t<=s:
    f = 1
    m = min(m,c)
if f == 0:
  print("TLE")
else:
  print(m)

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

cc = [[0, 0] for x in range(N)]
for i in range(N):
    c = input().split(' ')
    cc[i][0] = int(c[0])
    cc[i][1] = int(c[1])

min_cost = -1
for c1, c2 in sorted(cc):
    if c2 <= T:
        min_cost = c1
        break

print (min_cost if min_cost != -1 else 'TLE')

Solution (Python):
n,t=map(int,input().split())
l=[]
for i in range(n):
    l.append([j for j in map(int,input().split())])
    
a=1001
for i in l:
    if i[1] <= t and i[0] < a:a=i[0]
if a > 1000:
    a = 'TLE'
print(a)

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

import numpy as np

data = np.array([[int(i) for i in input().split()]for j in range(n)])

data = data[data[:,1]<=t][:,0]

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

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

c = []
t = []
for n in range(N):
    inputs = input().split()
    c.append(int(inputs[0]))
    t.append(int(inputs[1]))

min_cost = "TLE"
for i in range(N):
    if t[i] <= T and (min_cost is "TLE" or c[i] <= min_cost):
        min_cost = c[i]

print(min_cost)

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

Solution (Python):
N, T = map(int, raw_input().split())
ans = 1001
for i in range(0, N):
	c, t = map(int, raw_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())
e = [[int(i) for i in input().split()] for i in range(N)]
minc=1001
for v in e:
	if v[0]<minc and v[1]<=T:
		minc = v[0]
if minc == 1001:
	print("TLE")
else:
	print(minc)

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 = 1001
for i in range(N):
    if(t[i] <= T ):
        if(min > c[i]):
            min = c[i]

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

Solution (Python):

i = 1
min = 10000000
N, T = map(int, input().split())

while True:
    c, d = map(int, input().split())
    if d <= T:
        if c < min:
            min = c
    if i == N:
        break
    i += 1


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

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

if(min(list) == 9999):
    print("TLE")
else:
    print(min(list))

Solution (Python):
n, t = map(int, input().strip().split())
ans = 1e9
for i in range(n):
  x, y = map(int, input().strip().split())
  if y <= t:
    ans = min(x, ans)
print(ans if ans < 1e6 else 'TLE')

Solution (Python):

init = map(int, raw_input().split())
found = False
for loopnum in range(init[0]):
	scanline = map(int, raw_input().split())
	if scanline[1] <= init[1]: 
		if found == False:
			mincost = scanline[0]
			found = True
		else:
			if scanline[0] < mincost:
				mincost = scanline[0]

if found == False:
	print "TLE"
else:
	print mincost

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

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

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

Solution (Python):

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

root_list = []
cost = 1001
for i in range(N[0]):
    root_list.append(list(map(int,input().split())))

    if root_list[i][1] <= N[1]:
        if root_list[i][0] < cost:
            cost = root_list[i][0]


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

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

ans = 12345

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

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

Solution (Python):



from math import *
from string import *
from itertools import *
from copy import *

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

Solution (Python):
n, t = map(int, input().split())
cmin = 999999
for _ in range(n):
	ci, ti = map(int, input().split())
	if ti <= t and ci < cmin:
		cmin = ci
if cmin <= 1000:
	print(cmin)
else:
	print("TLE")

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)
    else:
        pass
        
if a==1001:
    print('TLE')
else:
    print(a)

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

Solution (Python):
import numpy as np
N, T = (int(_) for _ in input().split())
e = [[int(i) for i in input().split()] for i in range(N)]
T_list=[]
for j in range(N):
  if e[j][1]<=T:
    T_list.append(e[j][0])
if len(T_list)==0:
  print ("TLE")
else:
  print (np.min(T_list))

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

Solution (Python):
inN,inT = list(map(int,input().split()))
outC = 1001
for i in range(inN):
  inCi,inTi = list(map(int,input().split()))
  if inTi <= inT and inCi < outC:
    outC = inCi

if outC != 1001:
  print(outC)
else:
  print("TLE")

Solution (Python):
n, T = map(int, input().split())
list = []
ans = 1e9
for i in range(n) :
    c, t = map(int, input().split())
    if t <= T :
        if c < ans :
            ans = c;
if ans == 1e9 :
    print("TLE")
else :
    print(ans)

Solution (Python):
nt = map(int, raw_input().split())
cheapest = 1001
for i in range(nt[0]):
    ct = map(int, raw_input().split())
    if ct[1] <= nt[1]:
        if ct[0] < cheapest:
            cheapest = ct[0]
if cheapest == 1001:
    print("TLE")
else:
    print(cheapest)

Solution (Python):
N, T = map(int, input().split())
c_min = 1000
count = 0
for i in range(N):

    c, t = map(int, input().split())
    if t <= T and c <= c_min:
        count += 1
        c_min = c
if count == 0:
    print('TLE')
else:
    print(c_min)

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

Solution (Python):
N, T = map(int, input().split())
l = [list(map(int, input().split())) for val in range(N)]
l2 = [l[n][0] for n in range(N) if l[n][1] <= T]
l2.sort()
if not l2:
    print("TLE")
else:
    print(l2[0])

Solution (Python):
l = input().split()
c = []
t = []
for i in range(int(l[0])):
    c1,t1 = [int(i) for i in input().split()]
    c.append(c1)
    t.append(t1)
cost = 10000
for i in range(int(l[0])):
    if t[i] <= int(l[1]):
        if c[i] <= cost:
            cost = int(c[i])
if cost == 10000:
    print('TLE')
else:
    print(cost)

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

Solution (Python):


N,T = map(int,input().split())
moto=[]
mini = []
for i in range(N):
    c,t = map(int,input().split())
    if t<=T:
        mini.append(c)
if len(mini) >= 1:
    print(min(mini))
else:
    print("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())

DEKAI = 1<<30
MIN = DEKAI
for i in range(n):
    if t[i] <= T:
        MIN = min(MIN, c[i])

if MIN == DEKAI:
    print("TLE")
else:
    print(MIN)

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

Solution (Python):
INF = 2**30
n, T = map(int, raw_input().split())
best = INF
for i in range(n):
    c, t = map(int, raw_input().split())
    if t <= T:
        best = min(best, c)
print "TLE" if best == INF else best

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

min_c = 1001
min_c_i = 0

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

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

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

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

for c,t in list:
    if t <= T:
        cnt += 1
        comp_cost = c
        if comp_cost < min_cost:
            min_cost = comp_cost

if cnt >= 1:
    print(min_cost)
elif cnt == 0:
    print('TLE')

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

Solution (Python):
list = input().split()
list = [int(s) for s in list]

N = list[0]
T = list[1]

c = [0]*N
t = [0]*N

for i in range(N):
    templist = input().split()
    templist = [int(s) for s in templist]
    c[i] = templist[0]
    t[i] = templist[1]

    i = i + 1

n = 0

for i in range(N):
    if t[i] <= T:
        n = n + 1
    
    i = i + 1

if n == 0:
    print("TLE")

else:

    d = [0]*n
    k = 0

    for i in range(N):
        if t[i] <= T:
            d[k] = c[i]
            k = k + 1

    m = d[0]

    for j in range(n):
        if m >= d[j]:
            m = d[j]
    
        j = j + 1

    print(m)

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

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

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

cost = 1000
check = -1
for i in range(N):
    if t[i] <=T and c[i] <= cost:
        check = i
        cost = c[i]
        
        

if check == -1:
    print('TLE')
else:
    print(cost)

Solution (Python):
N, T = map(int, input().split())
cost = 1001
for i in range(N):
    ci, ti = map(int, input().split())
    if ti <= T and cost > ci:
        cost = ci
if cost > 1000:
    print('TLE')
    exit()
print(cost)

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

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

cost = 0

for i in range(N):
    if array[i][1] <= T and (cost == 0 or cost > array[i][0]):
        cost = array[i][0]
if cost == 0:
    print('TLE')
    exit()
print(cost)

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

for i in range(len(ct)):
    if ct[i][1]>T:
        continue
    else:
        print(ct[i][0])
        exit(0)
print('TLE')

Solution (Python):
n,T=map(int,input().split())
c=[]
t=[]
ans=2e31-1
for i in range(n):
    c,t=map(int,input().strip().split(' '))
    if t<=T:
        ans=min([ans,c])
if  ans==2e31-1:
    print("TLE")
else:
    print(ans)

Solution (Python):
import sys
N, T0 = map(int, sys.stdin.readline().split(" "))
L = sys.stdin.readlines()

isFound = False
ans = 0

for item in L:
  c, t = map(int, item.split(" "))
  if t <= T0:
    if isFound == False:
      ans = c
    else:
      ans = min(c, ans)
    isFound = True

if isFound == False:
  print("TLE")
else:
  print(str(ans))

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

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

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

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

c = []
t = []
for i in range(N): 
    tmp = [0, 0] 
    tmp[0], tmp[1] = map(int, input().split()) 
    
    c.append(tmp[0])
    t.append(tmp[1])
index = -1 
cost = 1000 
for i in range(N): 
    if t[i] <= T and c[i] <= cost: 
        index = i
        cost = c[i]
if index == -1: 
    print('TLE')
else:
    print(cost)

Solution (Python):
N, T = map(int, input().split())
c = []
t = []
for i in range(N):
    tmp = [0, 0]
    tmp[0], tmp[1] = map(int, input().split())
    c.append(tmp[0])
    t.append(tmp[1])
index = -1
cost = 1000
for i in range (N):
    if t[i] <= T and c[i] <= cost:
        index = i
        cost = c[i]
if index == -1:
    print('TLE')
else:
    print(cost)

Solution (Python):
n,l = map(int, raw_input().split())
mn = 2000
for _ in range(n):
    c,t = map(int, raw_input().split())
    if t <= l:
        mn = min(mn,c)
if mn == 2000:
    print 'TLE'
else:
    print mn

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

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

Solution (Python):

n,t = map(int,input().split())
ans_cost = 10000
ans_time = t

for i in range(n):
    a,b = map(int,input().split())
    if b<=ans_time:
        if a<ans_cost:
            ans_cost = a


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

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

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