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

c_min = 1001
t_ = None
for _ in range(N):
    c, t = map(int, input().split())
    if T >= t and c_min > c:
        c_min = c
        t_ = t
if t_ == None:
    print("TLE")
else:
    print(c_min)

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

for i in range(N):
  if int(c[i][1]) <= T:
    num = min(num, int(c[i][0]))

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

Solution (Python):
n,t=map(int,input().split())
ans=1001
for _ in range(n):
  cost,time=map(int,input().split())
  if time<=t:
    ans=min(ans,cost)
print(ans if ans!=1001 else "TLE")

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

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

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

ct.sort()

ans = 0
for i in range(n):
    if ct[i][1] <= k:
        ans = ct[i][0]
        break

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

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

path = []
for _ in range(N):
  c, t = list(map(int, input().split()))
  if t <= T:
    path.append(c)
path.sort()
if len(path) > 0:
  print(path[0])
else:
  print('TLE')

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

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

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

answer = float('inf')
ct = zip(c,t)
for i,j in ct:
    if j<=T:
        answer = min(answer, i)

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

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

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

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

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

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

INF = 10**3 + 1

c_min = INF

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

print("TLE" if c_min == INF else c_min)

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

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())
lis = []
for i in range(n):
    x = list(map(int,input().split()))
    lis.append(x)
ans = 1001    
for j in lis:
    if j[1] <= t and j[0] < ans:
        ans = j[0]
if ans == 1001:
    print("TLE")
else:
    print(ans)

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

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

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

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

d = {}
for _ in range(N):
    Ns = [int(i) for i in input().split()]
    time = Ns[1]
    if time <= T:
        d[Ns[0]] = time
if d:
    print(min(d))
else:
    print('TLE')

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

d = {}
for _ in range(N):
    Ns = [int(i) for i in input().split()]
    time = Ns[1]
    if time <= T:
        d[Ns[0]] = Ns[1]
if d:
    print(min(d))
else:
    print('TLE')

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

time = dict()
for i in range(N):
	c,t = input().split(" ")
	time[int(c)] = int(t)
cost = 10000

for key, value in sorted(time.items(), key=lambda item: item[1]):
	if value <= T:
		if cost > key:
			cost = key
			

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

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

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

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

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

for c, ti in sorted(ct):
	if int(ti) <= t:
		print(c)
		exit()
	

print("TLE")

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

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

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

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

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())
W=[list(map(int,input().split())) for i in range(N)]
flag=0
cost=0
W.sort(key=lambda x:x[0])

for i in range(N):
    if (W[i][1]<=T):
        flag=1
        cost=W[i][0]
        break

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

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

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

Solution (Python):
def main():
    N, T = map(int, input().split(" "))
    cost = 10000
    tle = 0
    for _ in range(N):
        c, t = map(int, input().split(" "))
        if t > T:
            tle += 1
            continue
        else:
            cost = min(cost, c)
    if tle == N:
        print("TLE")
    else:
        print(cost)


if __name__ == '__main__':
    main()

Solution (Python):

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

l = sorted(l) 

for j in range(n):
    if l[j][1] <= t:
        print(l[j][0])
        break
else:
    print('TLE')

Solution (Python):

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


l = sorted(l)


for j in range(n):
    if l[j][1] <= t:
        print(l[j][0])
        break
else:
    print('TLE')

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

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

Solution (Python):

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
n,time= map(int,input().split())
c = []
t = []
for i in range(n):
    a,b = map(int,input().split())
    c.append(a)
    t.append(b)
ans = 1001
for i in range(n):
    if time >= t[i]:
        if ans >= c[i]: ans = c[i]
if ans == 1001: print("TLE")
else: print(ans)

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

ans = 1001

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

print('TLE' if ans > 1000 else ans)

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

ans = 1<<60
for _ in range(N):
  cost, time = map(int, input().split())
  if time <= T:
    ans = min(cost, ans)
print(ans if ans < 1<<60 else "TLE")

Solution (Python):
import sys
import math
import itertools

n,T=list(map(int,input().split()))
num=[]
for i in range(n):
	c,t=list(map(int,input().split()))
	if T>=t:
		num.append(c)
if num==[]:
	print("TLE")
else:
	print(min(num))

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

min_cost = 1001

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

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

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

for i in range(n):
    if ct[i][1] <= t:
        print(ct[i][0])
        exit()
    if i == n - 1:
        print("TLE")

Solution (Python):
import sys

INPUT = lambda: sys.stdin.readline().rstrip()
MAP = lambda: map(int, INPUT().split())

sys.setrecursionlimit(10 ** 9)
INF = float('inf')


def main():
    N, T = MAP()

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

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


if __name__ == '__main__':
    main()

Solution (Python):
n,limit = map(int, input().split())
cost = float('INF')
for i in range(n):
  c,t = map(int, input().split())
  if limit >= t and cost > c:
    cost = c
if cost <= 1000:
  print(cost)
else:
  print('TLE')

Solution (Python):
"""
author : halo2halo
date : 22, Jan, 2020
"""

import sys
import itertools
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

N, T = map(int, readline().split())
ans = 10000
for _ in range(N):
    c, t = map(int, readline().split())
    if c <= ans and t <= T:
        ans = c

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

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

Solution (Python):
N,T=map(int,input().split())
p=[]
for _ in range(N):
  c=list(map(int,input().split()))
  p.append(c)
ans=9999
for c in p:
  if c[1]<=T:
    if c[0]<ans:
      ans=c[0]
if ans==9999:
  print('TLE')
else:
  print(ans)

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

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

Solution (Python):
(N, T), *D,  = [list(map(int, s.split())) for s in open(0)]

min_cost = 1e10
idx = 0
for i in range(len(D)):
    if T >= D[i][1] and D[i][0] < min_cost:
        idx = i
        min_cost = D[i][0]

if min_cost == 1e10:
    print("TLE")
else:
    print(min_cost)

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

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

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

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

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

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

result = 1001
for i in cList:
  if i[1] <= t:
    if result > i[0]:
      result = i[0]

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

Solution (Python):
n,t = map(int,input().split())
l = [list(map(int,input().split())) for i in range(n)]
ans = 1001
for i,j in l:
  if t >= j:
    ans = min(ans,i)
if ans == 1001:
  print("TLE")
else:
  print(ans)

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

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

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

Solution (Python):
def solve():
    N, T = map(int, input().split())
    c, t = [0] * N, [0] * N
    for i in range(N):
        c[i], t[i] = map(int, input().split())

    ans = 2000
    for i in range(N):
        if t[i] <= T:
            ans = min(ans, c[i])
    if ans == 2000:
        print('TLE')
    else:
        print(ans)


if __name__ == '__main__':
    solve()

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

ans = 1001

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

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

Solution (Python):
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
def input(): return sys.stdin.readline().rstrip()

def main():
    N,T=map(int,input().split())
    ans=INF
    for _ in range(N):
        c,t=map(int,input().split())
        if t<=T:
            ans=min(ans,c)
    print(ans if ans!=INF else 'TLE')

if __name__ == '__main__':
    main()

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

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

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

Solution (Python):

N,T = map(int,input().split())
ans = [1001,0]
status = 0

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

    if t <= T and c < ans[0]:
        ans[0] = c
        ans[1] = t
        status = 1
    else:
        pass

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

Solution (Python):
n, T = map(int, input().split())
p = []
for i in range(n):
   tmp = [int(x) for x in input().split()]
   p.append(tmp)

cmin = 1001
for c, t in p:
   if (t <= T and c < cmin):
      cmin = c

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

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

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

flag = False
mins = 10000
for i in range(N):
  s, t = list(map(int, input().split()))
  if T >= t:
    mins = s if mins > s else mins
    flag = True
    
print(mins if flag is True else 'TLE')

Solution (Python):
N,T=map(int,input().split())
A=[list(map(int,input().split())) for i in range(N)]
B=sorted(A)
cnt=0
for i in range(N):
  if B[i][1]<=T:
    print(B[i][0])
    exit()
  else:
    cnt+=1
if cnt==N:
  print('TLE')

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

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

Solution (Python):
import sys

inf = float('inf')

n, T, *ct = map(int, sys.stdin.read().split())
ct = zip(*[iter(ct)] * 2)

def main():
    res = inf
    for c, t in ct:
        if t <= T:
            res = min(res, c)
    
    return res if res != inf else 'TLE'

if __name__ == '__main__':
    ans = main()
    print(ans)

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

ans = 1001

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

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

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

y = []

for i in x:
  if i[1] <= t:
    y.append(i)

y.sort()

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

Solution (Python):
N, T = map(int, input().split())
c_t_list = [list(map(int, input().split())) for _ in range(N)]
c_t_list = [c_t for c_t in c_t_list if c_t[1] <= T]
if c_t_list:
    print(sorted(c_t_list)[0][0])
else:
    print('TLE')

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

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

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

cl = []
tl = []

for i in range(n):
    cw,tw = map(int, input().split())

    if tw <= t:
        cl.append(cw)
        tl.append(tw)

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

Solution (Python):
import sys
input = sys.stdin.readline
N, T = map(int, input().split())
min = 1000
flag = False
for i in range(N):
    c, t = map(int, input().split())
    if t <= T and c <= min:
        min = c
        flag = True
if flag:
    print(min)
else:
    print("TLE")

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

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

cost = []

for i in range(n):
    if c_t[i][1] <= t:
        cost.append(c_t[i][0])
if len(cost) == 0:
    print("TLE")
else:
    print(min(cost))

Solution (Python):

 
import math
import itertools
import sys
import copy
 





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


ans = sys.maxsize
TLEflag = True
for i in range(N) :
  if L[i][1] <= T :
    ans = min(ans, L[i][0])
    TLEflag = False

if TLEflag == True :
  print ("TLE")
else :
  print (ans)

Solution (Python):
N,T=map(int,input().split())
ct=[list(map(int,input().split())) for _ in range(N)]
ans_l=[]
for i in range(N):
    if ct[i][1]<=T:
        ans_l.append([ct[i][0],i+1])
if ans_l==[]:
    print('TLE')
else:
    len_ans_l=len(ans_l)
    ans=float('inf')
    for i in range(len_ans_l):
        if ans_l[i][0]<ans:
            ans=ans_l[i][0]
    print(ans)

Solution (Python):
import sys
input = sys.stdin.readline
N,T = [int(i) for i in input().split()]
minc = 100000
for i in range(N) :
    c,t = [int(i)for i in input().split()]
    if t > T :
        continue
    else :
        minc = min(minc,c)
if minc == 100000 :
    print("TLE")
else :
    print(minc)

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

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

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

Solution (Python):
import bisect
import cmath
import heapq
import itertools
import math
import operator
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7



N , t = list(map(int, sys.stdin.buffer.readline().split()))
C, T  = list(zip(*[map(int, sys.stdin.buffer.readline().split()) for _ in range(N)]))

C = np.array(C, dtype=int)
T = np.array(T, dtype=int)

if np.any(T <= t):
    ans = C[T <= t].min()
    print(ans)
else:
    print('TLE')

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

if min(t) > T:
    print("TLE")
    sys.exit()

cost = float("inf")
for i in range(N):
    if t[i] <= T:
        cost = min(cost, c[i])
print(cost)

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

if 0 < len(x):
    print(min(x))
else:
    print('TLE')

Solution (Python):
N,T=map(int,input().split())
li=[]
a=0
for i in range(N):
    li.append(list(map(int,input().split())))
    if li[i][1]<=T:
        a+=1
li.sort()
if a==0:
    print('TLE')
else:
    for i in range(N):
        if li[i][1]<=T:
            print(li[i][0])
            break

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

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

if len(A) >= 1:
    print(min(A))
else:
    print("TLE")

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

INF=2**51+1
ans=INF
for k in range(N):
    if t[k]<= T:
        ans = min(ans, c[k])
        
if ans==INF:
    print("TLE")
else:
    print(ans)

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

for c, t in lst:
    if t <= T:
        tmp = min(tmp, c)

print(tmp) if tmp != 9999 else print('TLE')

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

for i in range(N):
    c, t = map(int, input().split())
    if t > T :
        continue
    else:
        costs.append(c)

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

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

ans = -1
cst = 10**5
for i in range(n):
    c,tm = map(int,input().split())
    if tm <= t and c <cst:
        cst = c
        ans = c

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

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

for i in range(N):
    lst.append(x[i][1])

if min(lst) <= T:
    for i in range(N):
        if x[i][1] <= T:
            lst2.append(x[i][0])

    print(min(lst2))

else:
    print('TLE')

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

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

for i in range(n):
	c, t = map(int,input().split())
	if t > T:
		continue
	if ans_c >= c:
		ans_c, ans_t = c, t
	
print(ans_c if ans_t != 1001 else 'TLE')

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

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

for lst in lstct:
    if lst[1] <= t:
        ans = min(ans,lst[0])
else:
    if ans == 1001:
        ans = "TLE"

print(ans)

Solution (Python):
import math
import collections
import itertools
import sys
import bisect
from heapq import heappop,heappush,heapify
sys.setrecursionlimit(10**6)
def MAP(): return list(map(int,input().split()))
def INT(): return int(input())
def FLOAT(): return float(input())
MOD = 10**9+7
INF = 10**9

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

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

ans = 10**9

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

if ans == 10**9:
    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(ans)
else:
    print('TLE')

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

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

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


min_cost = 1001
for c, t in [input().split() for _ in range(N)]:
    c, t = int(c), int(t)
    if t > T:
        continue
    min_cost = min(min_cost, c)

ans = min_cost if min_cost < 1001 else "TLE"
print(ans)

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

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

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

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

for i in range(n):
  if k[i][-1]<=t:
    cost=k[i][0]
    mincost=min(mincost,cost)
if mincost==1000000:
  print("TLE")
else:
  print(mincost)

Solution (Python):
ans = 10000
N, T = map(int, input().split())
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 = list(map(int,input().split()))
C = [list(map(int, input().split())) for i in range(N)]
ans = 10000
C = sorted(C,key=lambda x:x[0])
for i in range(N):
  if C[i][1] <= T:
    ans = C[i][0]
    break
if ans == 10000:
  print("TLE")
else:
  print(ans)

Solution (Python):
import math

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

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

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

for i in range(N):
    cost, time = map(int, input().split())
    if time > T:
        continue
    else:
        costs.append(cost)
if len(costs) != 0:
    print(min(costs))
else:
    print('TLE')

Solution (Python):
N,T=map(int,input().split())
lst=[0]*N
a=0
b=0
min_c=float("inf")
t=0
for i in range(N):
    a,b=map(int,input().split())
    if b<=T:
        min_c=min(min_c,a)
if min_c==float("inf"):
    min_c="TLE"
print(min_c)

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

stt = []
for i in ct:
    if i[1] <= t:
        stt.append(i[0])
if len(stt) == 0:
    print("TLE")
else:
    ans = min(stt)
    print(ans)

Solution (Python):
import sys

n, t = map(int, sys.stdin.readline().split())
l = [tuple(map(int, sys.stdin.readline().split())) for _ in range(n)]

ans = 10000000000000000000
flag = False
for cost, time in l:
    if time > t:
        continue

    if cost < ans:
        ans = cost
        flag = True

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

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

Solution (Python):
n,T=map(int,input().split())
a=[]
ans=10000
for i 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())
l = [list(map(int, input().split())) for i in range(n)]
l.sort(key=lambda x: x[1])
ans = 9999999999
if l[0][1] > t:
    print("TLE")
else:
    for i in range(n):
        if l[i][1] <= t:
            ans = min(ans, l[i][0])
    print(ans)

Solution (Python):

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

ans = []
x = 0
for i in range(N):
    if a[i][1] > T:
        x += 1
    if a[i][1] <= T:
        ans.append(a[i][0])

if x == N:
    print("TLE")
else:
    print(min(ans))