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())
minc=9999
for i in range(N):
    c, t = map(int,input().split())
    if t<=T and c < minc:
        minc=c
if minc==9999:
    print("TLE")
else:
    print(minc)

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

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

ans = 1e9

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

if(ans == 1e9): print("TLE")
else: print(ans)

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

Solution (Python):
def main():
    n, T = map(int, input().split())
    ans = None
    for _ in range(n):
        c, t = map(int, input().split())
        if t <= T and (ans is None or c < ans):
            ans = c
        
    if ans is None:
        print('TLE')
    else:
        print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
n, T = map(int, input().split())
res = 2e3
for _ in range(n):
    c, t = map(int, input().split())
    if t <= T:
        res = min(c, res)
if res < 2e3:
    print(res)
else:
    print('TLE')

Solution (Python):
import sys

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

flag = False
min_c = sys.maxsize
for i in range(1, N + 1):
    c, t = map(int, input().split())

    if t > T:
        continue

    min_c = min(c, min_c)
    flag = True

if flag is True:
    print(min_c)
else:
    print("TLE")

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

ans = 10000
for v in ct:
    if v[1] <= T:
        ans = min(ans, v[0])

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

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

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

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

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

    ans = 10000
    for i in lst:
        if i[1] <= t:
            ans = min(ans,i[0])

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


if __name__ == "__main__":
        main()

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

Solution (Python):



def main():
    N, T = map(int, raw_input().split())
    ans = 9999999

    for idx in xrange(N):
        c, t = map(int, raw_input().split())
        if t <= T:
            ans = min(c, ans)

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


if __name__ == "__main__":
    main()

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

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

nums.sort(key=lambda x:x[0])
for i in range(n):
  if nums[i][1] <= t:
    print(nums[i][0])
    exit()
print('TLE')

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

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

if ans_cost == 9999999:
    print('TLE')
else:
    print(ans_cost)

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

N, T = map(int,input().split())
A = []
B = []

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

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

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

Solution (Python):
n, t = map(int, input().split())
c = float('inf')
for _ in range(n):
    ci, ti  = map(int, input().split())
    if ti <= t:
        c = min(ci, c)
if c == float('inf'):
    print('TLE')
else:
    print(c)

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

min_c = 1001

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

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

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

b = []

c = []

for i in range(a[0]):
    b.append(list(map(int,input().split())))

for i in range(a[0]):
    if b[i][1] <= a[1]:
        c.append(b[i])

c.sort()

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

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

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

arr = []
for _ in range(n):
    arr.append([int(e) for e in input().split()])

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

for k,i in enumerate(arr):
    if i[1] <= t:
        print(i[0])
        break
    if k == len(arr)-1:
        print('TLE')

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

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

result =float('inf')

for c,t in CT:
    if t<=T:
        result = min(result,c)

if result==float('inf'):
    print("TLE")
else:
    print(result)

Solution (Python):
def solve(r, T):
    d = [int(i[0]) for i in r if int(i[1]) <= T]
    if len(d):
        return min(d)
    else:
        return "TLE"


if __name__ == "__main__":
    N, T = tuple(input().split(" "))
    r = [input().split(" ") for i in range(int(N))]
    print(solve(r, int(T)))

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

ans = 9999
for c,t in ct:
    if t <= T:
        ans = min(ans, c)
    
if ans == 9999:
    print("TLE")
else:
    print(ans)

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

m = 9999
for i in range(N):
    if t[i] <= T:
        if c[i] < m:
            m = c[i]
if m == 9999:
    print("TLE")
    exit()

print(m)

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

ct.append((1001, 1))
a = min([c for c, t in ct if T >= t])
if a != 1001:
    print(a)
else:
    print("TLE")

Solution (Python):
a = input().split()
a = [int(i) for i in a]
task = []
for i in range(a[0]):
    temp = input().split()
    temp = [int(i) for i in temp]
    task.append(temp)

lister = []
for i in task:
    if i[1] <= a[1]:
        lister.append(i[0])

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

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

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

c=[]
t=[]

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

ans=1000000   
for i in range(n):
    if t[i]<=T:
        ans=min(ans,c[i])
        
if ans==1000000:
    print("TLE")
else:
    print(ans)

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

if ans == 10**10:
    print("TLE")
else:
    print(ans)

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

current_c = 10000

for n in range(N):
  c, t = map(int, input().split())
  if t > T:
    continue
  if current_c > c:
    current_c = c

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

Solution (Python):


def main():
    N, T = list(map(int, input().split()))
    paths = []
    for i in range(N):
        c, t = list(map(int, input().split()))
        paths.append((c, t))
    paths = sorted(paths, key=lambda x: x[0])

    for p in paths:
        if p[1] <= T:
            print(p[0])
            exit()
    print("TLE")


if __name__ == '__main__':
    main()

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

minc = 1001

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

Solution (Python):
if __name__ == '__main__':
    N, T = map(int, input().split())
    r = []
    for i in range(N):
        r.append(list(map(int, input().split())))
    tmp = 1e+9
    for i in range(N):
        if r[i][1] <= T:
            if r[i][0] < tmp:
                tmp = r[i][0]

    if tmp == 1e+9:
        print('TLE')
    else:
        print(tmp)

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

Solution (Python):

import math,string,itertools,fractions,heapq,collections,re,array,bisect

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

ans = max(C)+1

for i in range(N):
    t,c = T[i],C[i]
    if t <= TT:
        if ans > c:
            ans = c
if ans == max(C) + 1:
    print('TLE')
else:
    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:
    ans = min(c, ans)
if 1000 < ans:
  ans = 'TLE'
print(ans)

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

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


val = float("inf")
for c, t in route.items():
    if t <= T:
        if c <= val:
            val = c

if val < float("inf"):
    print(val)
else:
    print("TLE")

Solution (Python):
n, ti = [int(_) for _ in input().split(' ')]
cost = 1001
for i in range(n):
    c, t = [int(_) for _ in input().split(' ')]
    if t <= ti and c < cost:
        cost = c
if cost <= 1000:
    print(cost)
else:
    print('TLE')

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

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

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

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

Solution (Python):



    
def main(n, t, ct):
    rtl = []
    for i in range(n):
        if ct[i][1] <= t:
            rtl.append(ct[i][0])
    if rtl == []:
        print('TLE')
    else:
        print(min(rtl))
    
    
if __name__ == '__main__':
    try:
        n, t  = list(map(int,input().strip().split(' ')))
        ct = []
        for i in range(n):
            ct.append(list(map(int, input().strip().split(' '))))
        main(n, t, ct)
    except EOFError:
        pass

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

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

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

Solution (Python):
n,t = [int(i) for i in input().split()]
k = []
for i in range(n):
    ci,ti = [int(i) for i in input().split()]
    if t >= ti:
        k.append([ci,ti])

if len(k) == 0:
    print('TLE')
else:
    k.sort()
    print(k[0][0])

Solution (Python):

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

for i in range(N):
    c, t = list(map(int, input().split()))
    if t <= T and c < min_cost:
        min_cost = c
        
if min_cost == 9999:
    min_cost = 'TLE'
    
print(min_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:
        if c<ans:
            ans=c
if ans==10000:
    print("TLE")
else:
    print(ans)

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

mc = float("inf")
ans = "TLE"

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

print(ans)

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

Solution (Python):

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

Solution (Python):





"""
RC112 B
"""

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

costs = []
for i in range(n):
    ci,ti = map(int,input().split())
    if ti <= t:
        costs.append(ci)

if bool(costs):
    print(min(costs))
else:
    print('TLE')

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

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

min = 10000

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

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

Solution (Python):
n, t = [int(i) for i in input().split()]
r = [[int(i) for i in input().split()] for j in range(n)]
min_cost = 10000
for i in r:
    if i[1] <= t:
        if i[0] < min_cost:
            min_cost = i[0]
if min_cost == 10000:
    print('TLE')
else:
    print(min_cost)

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

ct = [tuple(map(int, input().split())) for _ in range(N)]
ct = sorted(filter(lambda x: x[1] <= T, ct), key=lambda x: x[0])
try:
    print(ct[0][0])
except IndexError:
    print("TLE")

Solution (Python):


INF = float('inf')


def inpl(): return list(map(int, input().split()))


N, T = inpl()
X = []
for i in range(N):
    c, t = inpl()
    X.append([t, c])

X.sort()
ans = INF
for i in range(N):
    if X[i][0] > T:
        break
    if X[i][1] < ans:
        ans = X[i][1]

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

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 = 99999

    for a in A:
        cost, time = a

        if time <= T and cost < ans:
            ans = cost

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


main()

Solution (Python):
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

n,t = na()
ct = [na() for _ in range(n)]

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

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

Solution (Python):
N, T = map(int, input().split())
min_cost = float('inf')
for i in range(N):
    c, t = map(int, input().split())
    if t <= T and c < min_cost:
        min_cost = c

print(min_cost if min_cost != float('inf') else "TLE")

Solution (Python):
nums = [int(num) for num in input().split()]
n = nums[0]
T = nums[1]
ans = 10000
for i in range(n):
    ct = [int(num) for num in input().split()]
    c = ct[0]
    t = ct[1]
    if t <= T:
        ans = min(ans,c)
if ans == 10000:
    print("TLE")
else:
    print(ans)

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

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

Solution (Python):
n,T=[int(x) for x in input().split()]
ans=10**10
for _ in [0]*n:
    ci,ti=[int(x) for x in input().split()]
    if ti<=T:
        ans=min(ci,ans)
if ans==10**10:
    print("TLE")
else:
    print(ans)

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

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

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

ans = 1001
for _ 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())
f=0
mins=99999999
for i in range(n):
    a,b=map(int,input().split())
    if b<=T:
        f=1
        mins=min(mins,a)
if f:
    print(mins)
else:
    print('TLE')

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

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

if c:
    print(min(c))
else:
    print("TLE")

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

N, T = [int(elem) for elem in input().split(' ')]
cost_and_times = [[int(elem) for elem in fin().split(' ')] for _ in range(N)]
min_cost = float('inf')
for c, t in cost_and_times:
    if t <= T:
        min_cost = min(min_cost, c)

if min_cost == float('inf'):
    print("TLE")
else:
    print(min_cost)

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

ans = 10 ** 9

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

if ans == 10 ** 9:
    print('TLE')
else:
    print(ans)

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

ans = 10**9

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

if ans == 10**9:
    print("TLE")
else:
    print(ans)

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

Solution (Python):
def getN():
    return int(input())

def getMN():
    a = input().split()
    b = [int(i) for i in a]
    return b[0],b[1]

def getlist():
    a = input().split()
    b = [int(i) for i in a]
    return b

N, T = getMN()

maxtime = 10000000000
roots = []
for i in range (N):
    a,b = getMN()
    roots.append((a,b))

for root in roots:
    if root[1] <= T:
        if root[0] < maxtime:
            maxtime = root[0]

if maxtime > 10000000:
    print("TLE")
else:
    print(maxtime)

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

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

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

Solution (Python):

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

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

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

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

Solution (Python):

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

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

if ret==10**5:
    print("TLE")
else:
    print(ret)

Solution (Python):
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

N,T = li()

ans = 10**5
for i in range(N):
    c,t = li()
    if t <= T:
        ans = min(ans,c)
     
if ans == 10**5:
    print("TLE")
else:
    print(ans)

Solution (Python):
N, T = map(int, input().split())
c, t = [0]*N, [0]*N
best = float('inf')
flag = False
for i in range(N):
    ci, ti = map(int, input().split())
    if ti <= T:
        flag = True
        best = min(best, ci)
if flag:
    print(best)
else:
    print('TLE')

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

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

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

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

c = []

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



a = 100000000
for i in c:
	if i[1] <= t:
		a = min(a,i[0])

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

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

ans = 10000
for c,t in ct:
    if t <= T:
        ans = min(c,ans)
print(ans if ans != 10000 else 'TLE')

Solution (Python):
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  

n, t = na()

mincost = 99999999999999
for i in range(n):
    c, u = na()
    if u <= t:
        mincost = min(mincost, c)

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

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

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

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

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

ans = float('inf')
flg = False
for c, t in CTs:
    if t <= T:
        flg = True
        ans = min(ans, c)

if flg:
    print(ans)
else:
    print('TLE')

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

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

Solution (Python):
n, time = [int(_) for _ in input().split()]
c = []
t = []
for i in range(n):
    ci, ti = [int(_) for _ in input().split()]
    if ti <= time:
        c.append(ci)
        t.append(ti)

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

Solution (Python):
import numpy as np

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

cs = []
ts = []
for k in range(n):
    cc, tt = list(map(int,input().split()))
    cs.append(cc)
    ts.append(tt)
    

try:
    print(np.min(np.array(cs)[np.array(ts)<=t]))
except:
    print('TLE')

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

ans = 10**4

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

print('TLE' if ans == 10**4 else ans)

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

ct.sort()

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

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

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

Solution (Python):


def main():
    n, T = map(int, input().split())
    arrys = [tuple(map(int, input().split())) for _ in range(n)]
    ans = float('inf')
    for arry in arrys:
        c, t = arry
        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())
ans = 10000
for i in range(n):
    c, t = map(int, input().split())
    if t <= T:
        ans = min(ans, c)
if ans < 10000:
    print(ans)
else:
    print("TLE")

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

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

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

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

Solution (Python):
n, t =  map(int, input().split())
index=0
cost1=[]
cost2=[]
time=[]
while index < n:
    c, t2 = map(int, input().split())
    if t2 < t+1:
        cost1.append(c)
        cost2.append(c)
        time.append(t2)
    index+=1
if cost1==[]:
    print("TLE")
else:
    print(min(cost1))

Solution (Python):

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

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

Solution (Python):
N,T=list(map(int,input().split()))
min_=1111
for i in range(N):
    c,t=list(map(int,input().split()))
    if t <=T:
        if min_>c:
            min_=c
if min_==1111:
    min_='TLE'
print(min_)