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, l = map(int, input().split())

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

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

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

min_cost = float("inf")
for c_t in c_t_list:
    if c_t[1] <= T:
        min_cost = min(min_cost, c_t[0])
if min_cost == float("inf"):
    print("TLE")
else:
    print(min_cost)

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)
result = []
for j in range(N):
  if T >= t[j]:
    result.append(c[j])
  else:
    None
print(min(result) if len(result) > 0 else "TLE")

Solution (Python):
def examA():
    N = I()
    if N==1:
        ans = "Hello World"
    elif N==2:
        A = I(); B = I()
        ans = A + B
    try:
        print(ans)
    except:
        print()
    return

def examB():
    N, T = LI()
    ans =  10**9
    for _ in range(N):
        c, t = LI()
        if T>=t and ans>c:
            ans = c
    if ans==10**9:
        ans = "TLE"
    print(ans)
    return

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

if __name__ == '__main__':
    examB()

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

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

Solution (Python):
import sys
import numpy as np
input = sys.stdin.readline
N, T = [int(x) for x in input().split()]
C = []
for _ in range(N):
    temp = [int(x) for x in input().split()]
    C.append(temp)
ans = []
for i in C:
    c, t = i
    if t <= T:
        ans.append(c)
if len(ans) > 0:
    print(min(ans))
else:
    print("TLE")

Solution (Python):
N,T=map(int,input().split())
cost=float('inf')
flg=0
for i in range(N):
    c,t=map(int,input().split())
    if t<=T:
        if c<cost:
            cost=c
            flg=1
        
if flg==0:
    print('TLE')
else:
    print(cost)

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

Solution (Python):
A,B = map(int,input().split())
q = 100000
for i in range(A):
  S = list(map(int,input().split()))
  if S[1] <= B and S[0] < q:
    q=S[0]
  else:
    pass
if q < 10000:
  print(q)
else:
  print('TLE')

Solution (Python):
n, t_limit = map(int, input().split())
list_c = []
for _ in range(n):
  c, t = map(int, input().split())
  if t <= t_limit:
    list_c.append(c)
if list_c != []:
  print(min(list_c))
else:
  print("TLE")

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

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

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

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

Solution (Python):
n,t = map(int, input().split())
c = 1001
for i in range(n):
    a,b = map(int, input().split())
    if b<=t:
        c = min(a,c)
print("TLE" if c == 1001 else 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(ans,c)
if ans==1001:
  print("TLE")
else:
  print(ans)

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

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



k = [c for c,s in [(I()) for _ in [0]*n] if s<=t]
print(min(k) if k!=[] else "TLE")

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

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

result = float('inf')
for _ in range(N):
    c, t = map(int, input().split())
    if t <= T and c < result:
        result = c
if result != float('inf'):
    print(result)
else:
    print('TLE')

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

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

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

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

Solution (Python):
n, T = map(int,input().split())
c0 = 1000
p = False
for i in range(n):
    c, t = map(int, input().split())
    if t <= T and c0 >= c:
        p = True
        c0 = c
if p:
    print(c0)
else:
    print('TLE')

Solution (Python):
N, T=list(map(int, input().split()))
CT=[list(map(int, input().split())) for i in range(N)]
ans=[]
CT = sorted(CT, key = lambda x:x[0] )
for i in range(N):
    if CT[i][1]<=T:
        ans.append(CT[i])
if ans ==[]:
    print('TLE')
else:
    print(ans[0][0])

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

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

Solution (Python):
n, t = map(int, input().split())
lc = []
lt = []
for i in range(n):
    c, tt = map(int, input().split())
    lc.append(c)
    lt.append(tt)

cost = 1001
for i in range(n):
    if lt[i] <= t:
        if lc[i] < cost:
            cost = lc[i]
if cost == 1001:
    print('TLE')
else:
    print(cost)

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

ans = 1001
for i in L:
    if i[1] <= T:
        ans = min(ans, i[0])

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

Solution (Python):
N,T=map(int,input().split())
ls=[list(map(int,input().split())) for _ in range(N)]
ans=10**18
for i in ls:
  if i[1] <= T:
    ans = min(ans,i[0])
if ans < 10**18:
  print(ans)
else:
  print('TLE')

Solution (Python):

from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
import itertools
from itertools import permutations, combinations
import sys
import bisect
import string
import math
import time
from fractions import gcd



def I(): return int(input())


def MI(): return map(int, input().split())


def LI(): return [int(i) for i in input().split()]


def LI_(): return [int(i)-1 for i in input().split()]


def StoI(): return [ord(i)-97 for i in input()]


def ItoS(nn): return chr(nn+97)


def input(): return sys.stdin.readline().rstrip()


def show(*inp, end='\n'):
    if show_flg:
        print(*inp, end=end)


YN = ['Yes', 'No']
MOD = 10**9+7
inf = float('inf')
l_alp = string.ascii_lowercase
u_alp = string.ascii_uppercase
ts = time.time()
sys.setrecursionlimit(10**6)


show_flg = False



def main():
    N, T = MI()
    cur = int(10**9)

    for i in range(N):
        c, t = MI()
        if t <= T and cur > c:
            cur = c

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


if __name__ == '__main__':
    main()

Solution (Python):
import numpy as np
N, T, *ct = map(int, open(0).read().split())

ct = np.array(ct).reshape((N, 2))
ct = ct[ct[:,1] <= T]

if ct.shape[0] == 0:
  print('TLE')
else:
  print(min(ct[:,0]))

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

ans = 1001

for i in range(n):
    if ls_ct[i][0] <= ans and ls_ct[i][1] <= t:
        ans = ls_ct[i][0]
        
if ans == 1001:
    print("TLE")
else:
    print(ans)

Solution (Python):


N,T=list(map(int,input().split(" ")))
minc,mint=1001,0

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

    if t<=T: 
        minc=min(minc,c)

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

Solution (Python):
N, T = map(int, input().split())
is_inT = False
min_c = 1000
for i in range(N):
    ct_i = [int(i) for i in input().split()]
    if ct_i[1] <= T:
        is_inT = True
        min_c = min(min_c, ct_i[0])
if is_inT:
    print(min_c)
else:
    print("TLE")

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

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

Solution (Python):

import sys
if sys.platform =='ios':
    sys.stdin=open('input_file.txt')

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

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

min = 100000

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

print(min if min!=100000 else 'TLE')

Solution (Python):
def inpl(): return list(map(int, input().split()))
N, T = inpl()
ans = 10**9

for _ in range(N):
    c, t = inpl()
    if t <= T:
        ans = min(ans, c)
if ans < 10**9:
    print(ans)
else:
    print("TLE")

Solution (Python):
n,time_max = map(int,input().split())
cost = []
time = []
for i in range(n):
  a = input().split()
  cost.append(int(a[0]))
  time.append(int(a[1]))

while True:
  min_index = cost.index(min(cost))
  if time[min_index] <= time_max:
    print(cost[min_index])
    break
  elif cost[min_index] == 1001:
    print("TLE")
    break
  else:
    cost[min_index] = 1001

Solution (Python):
nums = list(map(int, input().split())) 
n = nums[0]
t = nums[1]
minC = 1001
for i in range(n):
    numss = list(map(int, input().split()))
    c = numss[0]
    ti = numss[1]
    if ti <= t and minC > c:
        minC = c
if minC == 1001:
    print('TLE')
else:
    print(minC)

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

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

cost_now = 10000
for i in range(n):
	if cost_times[i][1] > t:
		continue
	elif cost_times[i][0] < cost_now:
		cost_now = cost_times[i][0]

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

Solution (Python):
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,copy,time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())

N,T = inpl()
ans = INF
for _ in range(N):
    c,t = inpl()
    if t <= T:
        ans = min(ans,c)


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

Solution (Python):

import sys
if sys.platform =='ios':
    sys.stdin=open('input_file.txt')

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

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

min = 100000

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

print(min if min!=100000 else 'TLE')

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

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

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


if __name__ == '__main__':
    main()

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

min_aaa =1001

for i in range(N):
    if T>= list_aaa[i][1]:
        min_aaa = min(min_aaa,list_aaa[i][0])

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

Solution (Python):


n,t =  (int(x) for x in input().split())

A = []
for i in range(n):
    c,ti  =  (int(x) for x in input().split())
    A.append([c,ti])

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

if A[0][1] > t:
    print("TLE")
else:
    min = A[0][0]
    for i in A:
        if i[1] > t:
            break
        
        if min > i[0]:
            min = i[0]
        
    print(min)

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

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

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

if min(cost) == 10001:
  print("TLE")
else:
  print(min(cost))

Solution (Python):
N, T = [int(num) for num in input().split()]
d = {}
for _ in range(N):
    c, t = [int(num) for num in input().split()]
    d[c] = t

c = None
for cost, minutes in d.items():
    if minutes <= T:
        if c is None:
            c = cost
            continue

        if c > cost:
            c = cost

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

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

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

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

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

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

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

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

ans=10000
for i in c:
    if i[1] <= t and i[0] < ans:
        ans = i[0]

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

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

Solution (Python):
n,t = map(int,input().split())
list1 = [list(map(int,input().split())) for i in range(n) ]
mintime = 10**9
for i in range(n):
    if list1[i][1] <= t:
        mintime = min(mintime,list1[i][0])

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

Solution (Python):
c, t = [int(x) for x in input().split()]
cost = 1001
try:
  while 1:
    path = [int(x) for x in input().split()]
    if path[1] > t:
      continue
    else:
      if path[0] < cost:
        cost = path[0]
except EOFError:
  if cost != 1001:
    print(cost)
  else:
    print('TLE')

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

for i in range(n):
	cost,time = [int(x) for x in input().split()]
	costs.append(cost)
	if time<=t: timeIndices.append(i)

mincostIndex=0
for i in timeIndices:
	if costs[i] < costs[mincostIndex]:
		mincostIndex=i

if (timeIndices): print(costs[mincostIndex])
else: print("TLE")

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

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

c = []
t = []

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

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

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

ans = 1000000007
for i in range(N):
    if ct[i][1] <= T:
        ans = min(ans, ct[i][0])

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

Solution (Python):
n,t=map(int,input().split())
d=[]
for i in range(n):
  x,y=map(int,input().split())
  if t >= y:
    d.append([x,y])
if len(d)>0:
  d.sort()
  print(d[0][0])
else:
  print("TLE")

Solution (Python):
N , T = map(int,input().split())
roots = [list(map(int,input().split())) for _ in range(N)]
min_cost = float("inf")
ans = "TLE"
for key , val in enumerate(roots):
    if val[0] < min_cost and val[1] <= T:
        min_cost = val[0]
        ans = val[0]
print(ans)

Solution (Python):
n, t = map(int, input().split())
candt = []
for _ in range(n) :
    candt += [list(map(int, input().split()))]
candidate = []
for i in range(n) :
    if candt[i][1] <= t :
        candidate += [candt[i]]

if candidate == [] :
    print("TLE")
else :
    costlist = [i[0] for i in candidate]
    print(min(costlist))

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

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

Solution (Python):

n, t = [int(s) for s in input().split()]

c = []

for i in range(n):

    tmp = [int(s) for s in input().split()]

    if tmp[1] <= t:
        c.append(tmp[0])

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

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

dic = {}
for val in range(n):
    c,ti = map(int,input().split())
    if ti <= t:
        dic[c] = ti

if dic == {}:
    print("TLE")
    exit()


dic = sorted(dic.items() ,key=lambda x:x[0])
print(dic[0][0])

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

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())
li=[]
for i in range(N):
  if t[i]<=T:
    li.append(c[i])
if len(li)==0:
  print('TLE')
else:
  print(min(li))

Solution (Python):
N, T = map(int, input().split())
ct = [tuple(map(int, input().split())) for _ in range(N)]
min_cost = 10**9 + 7
for c, t in ct:
    if t <= T:
        min_cost = min(min_cost, c)
print("TLE" if min_cost == 10**9 + 7 else min_cost)

Solution (Python):

import sys


def solve(N: int, T: int, c: "List[int]", t: "List[int]"):
    if min(t) > T:
        print("TLE")
    else:
        ans = max(c)
        for i in range(N):
            if t[i] <= T:
                ans = min(ans, c[i])
        print(ans)



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    T = int(next(tokens))  
    c = [int()] * (N)  
    t = [int()] * (N)  
    for i in range(N):
        c[i] = int(next(tokens))
        t[i] = int(next(tokens))
    solve(N, T, c, t)

if __name__ == '__main__':
    main()

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

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

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

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

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

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

Solution (Python):

import sys










def main():
    N, T = (int(x) for x in sys.stdin.readline().split())

    ct = []
    for i in range(N):
        c, t = (int(x) for x in sys.stdin.readline().split())
        if t <= T:
            ct.append((c, t))
    
    ct.sort()
    print(ct[0][0] if ct else 'TLE')


if __name__ == "__main__":
    main()

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

res = 10**12
flag = False
for _ in range(N):
    c, t = map(int, input().split())
    if t > T:
        continue
    flag = True
    res = min(c, res)

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

Solution (Python):
from sys import stdin
import bisect

n,t = [int(x) for x in stdin.readline().rstrip().split()]
li = [list(map(int,stdin.readline().rstrip().split())) for _ in range(n)]
li2 = []
for i in range(n):
    if li[i][1] <= t:
        li2.append(li[i][0])
if len(li2) == 0:
    print("TLE")
    exit()
li2.sort()
print(li2[0])

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()

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

main()

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

Solution (Python):
n,t=map(int,input().split())
cost,time=zip(*list(map(int,input().split()) for i in range(n)))
ans='TLE'
c=list(cost)
ti=list(time)
for i in range(n):
    sc=min(c)
    if ti[c.index(sc)]<=t:
        ans=sc
        break
    else:
        ti.pop(c.index(sc))
        c.remove(sc)


print(ans)

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

for i in range(firstLine[0]):
    line = list(map(int, input().split()))
    if line[1]> firstLine[1]:
        continue
    else:
        costs.append(line[0])

if len(costs)>0:
    print(sorted(costs)[0])
else:
    print("TLE")

Solution (Python):

import numpy as np
N, T = map(int, input().split())
c = np.zeros(N, dtype=int)
t = np.zeros(N)
for i in range(N):
  c[i], t[i] = map(int, input().split())

cc = c[t<=T]
if(len(cc) == 0):
  print('TLE')
else:
  print(min(cc))

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

minc = -1
for i in range(n):
  ci,ti = list(map(int,input().split()))
  if ti <= t:
    if minc == -1:
      minc = ci
    else:
      minc = min(minc,ci)

if minc == -1:
  print("TLE")
else:
  print(minc)

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

Solution (Python):
def MRX():
    N,T = input().split()
    N,T= int(N),int(T)
    travel = {}
    for i in range(N):
        c , t = input().split()
        travel[int(c)] = int(t)
    for j in sorted(travel):
        if travel[j] <= T:
            return j
    return "TLE"



print(MRX())

Solution (Python):
def mrx():
    N,T = input().split()
    N,T= int(N),int(T)
    travel = {}
    for i in range(N):
        c , t = input().split()
        travel[int(c)] = int(t)
    for j in sorted(travel):
        if travel[j] <= T:
            return j
    return "TLE"



print(mrx())

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

Solution (Python):
n,t=map(int,input().split())
c=[0]*n
T=[0]*n
count=1000000
ans=0
for i in range(n):
    c[i],T[i]=map(int,input().split())
if min(T)>t:
    print('TLE')
else:
    for j in range(n):
        if T[j]<=t:
            if c[j]<count:
                count=c[j]
                ans=c[j]
    print(ans)

Solution (Python):
n, t = map(int, input().split())
cost = 1e9
for i in range(n):
    cn, tn = map(int, input().split())
    if tn <= t and cost > cn:
        cost = cn
if cost == 1e9:
    print('TLE')
else:
    print(cost)

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

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

C = []

for _ in range(N):
  c,t = map(int,input().split())
  if t <= T:
    L = [c,t]
    C.append(L)
    
C = sorted(C,key = lambda x:x[0])

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

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

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

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

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

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

for n in range(N):
    temp = []
    c, t = map(int, input().split())
    temp += [c,t]
    C_T.append(temp)

C_can = []

for n in range(N):
    if C_T[n][1] <= T:
        C_can.append(C_T[n][0])

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

Solution (Python):
N, T = [int(x) for x in input().split()]
lst = []
for i in range(N):
    c, t = [int(x) for x in input().split()]
    if (t <= T): lst.append(c)
if (len(lst)):
    lst.sort()
    print(lst[0])
else:
    print('TLE')

Solution (Python):

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

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

min_cost = 10000

for ct in ct_list:
    if ct[1] <= T and ct[0] < min_cost:
        min_cost = ct[0]

if min_cost != 10000:
    print(min_cost)
else:
    print("TLE")

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

tmp.sort()

if len(tmp)==0:
    print('TLE')
else:
    print(tmp[0])

Solution (Python):

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

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

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

Solution (Python):
import sys
def input():
    return sys.stdin.readline()[:-1]
n,t=map(int,input().split())
ct=[list(map(int,input().split())) for i in range(n)]
ans=float('inf')
for i in range(n):
    if ct[i][1]<=t:
        ans=min(ans,ct[i][0])
if ans==float('inf'):
    print("TLE")
else:
    print(ans)

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

a=[]
for i in range(n):
    c,t=map(int,input().split())
    if T>=t:
        a.append(c)

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

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

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

select_list = []
for i in range(N):
    if t_list[i] > T:
        pass
    else:
        select_list.append(c_list[i])

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

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 = 1e5
for i in range(N):
	if t[i] <= T:
		ans = min(ans, c[i])
if (ans == 1e5) : print("TLE")
else : print(ans)

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

ret = float('inf')
for c, t in ct :
    if t <= T :
        ret = min(ret, c)

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

Solution (Python):
N,K=[int(s) for s in input().split()]
n=10000
for i in range(N):
  a,b=[int(s) for s in input().split()]
  if b<=K:
    n=min([n,a])
if n==10000:
  print("TLE")
else:
  print(n)

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

Solution (Python):
def main(n, t, c_t):
    cost = 10000

    for c, _t in c_t:
        if t >= _t:
            if c < cost:
                cost = c

    if cost == 10000:
        print('TLE')
        return

    print(cost)


if __name__ == "__main__":
    n, t = map(int, input().split(' '))
    c_t = list()
    for _ in range(n):
        c_t.append(map(int, input().split(' ')))

    main(n, t, c_t)

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

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