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())
ct=[list(map(int, input().split())) for i in range(n)]
c=[]
for i in range(n):
    if ct[i][1]<=t:
        c.append(ct[i][0])
print(min(c) if len(c)!=0 else "TLE")

Solution (Python):
from typing import List


def answer(n: int, t: int, cts: List[List[int]]) -> int:
    costs = [route[0] for route in cts if route[1] <= t]
    if not costs:
        return -1

    return min(costs)


def main():
    n, t = map(int, input().split())
    cts = [list(map(int, input().split())) for _ in range(n)]
    ans = answer(n, t, cts)
    print(ans if ans != -1 else 'TLE')


if __name__ == '__main__':
    main()

Solution (Python):
ma = lambda :map(int,input().split())
lma = lambda :list(map(int,input().split()))
tma = lambda :tuple(map(int,input().split()))
ni = lambda:int(input())
yn = lambda fl:print("Yes") if fl else print("No")
import collections
import math
import itertools
import heapq as hq
import sys
n,T = ma()
ans=10**15
for i in range(n):
    c,t=ma()
    if t<=T:
        ans=min(ans,c)
if ans==10**15:
    print("TLE")
else:print(ans)

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

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)
print(min(cl) if cl != [] else "TLE")

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(c, ans)

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

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

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

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

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

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

Solution (Python):


def main():
    n, time = map(int, input().split())
    ans = 1001
    for i in range(n):
        c, t = map(int, input().split())
        if t <= time:
            ans = min(ans, c)
    print(ans if ans != 1001 else 'TLE')


if __name__ == "__main__":
    main()

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

Solution (Python):
n,t = map(int,input().split())
ans = -1
for i in range(n):
    c,ti = map(int,input().split())
    if ti<=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())
c_list,t_list=[],[]
for i in range(n):
  x,y=map(int, input().split())
  c_list.append(x)
  t_list.append(y)
cost=1001
for i in range(n):
  if t_list[i]<=t and c_list[i]<cost:
    cost=c_list[i]
print(cost if cost<1001 else "TLE")

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

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 <= 1000:
    print(ans)
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)
if ans == 10000:
    print ('TLE')
else:
    print (ans)

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

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

print(cost)

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

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

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

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

Solution (Python):
def mapt(fn, *args):
    return tuple(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))
  

def main():
    n, t = Input()
    data = [Input() for _ in range(n)]
    ans = 1001

    for cost, time in data:
        if time <= t:
            ans = min(ans, cost)

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


main()

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

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

    mini = 10**10
    for i in range(n):
        if ct[i][1] <= t and ct[i][0] < mini:
            mini = ct[i][0]

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


if __name__ == '__main__':
    main()

Solution (Python):
n,T =map(int,input().split())
ans = 10**3+1
for i in range(n):
    c,t=map(int,input().split())
    if t > T:
        continue
    else:
        ans = min(ans,c)
if ans == 10**3+1:
    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 == 1001 else ans)

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

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

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

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

cost = 10000

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

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

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

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

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

N, T = [int(i) for i in input().split()]
ct_list = [ [int(i) for i in input().split()] for j in range(N)]

tmp = list(filter(lambda x: operator.ge(T,x[1]), ct_list))

ans = min(tmp, key=lambda x: x[0])[0] if len(tmp) != 0 else "TLE"
print(ans)

Solution (Python):





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





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

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

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

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

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

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 <= 1000 else print('TLE')

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

Solution (Python):
import math
from statistics import mean





e1,e2 = map(int,input().split())


h = []
for i in range(e1):
    h.append(list(map(int,input().split())))
r=[]
count=0
for i in range(e1):
    if h[i][1]<=e2:
         r.append(h[i][0])

if len(r)>0:
    print(min(r))
else:
    print("TLE")

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

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

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

ans = 1001

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

Solution (Python):
n,t = map(int,input().split())
l = [list(map(int,input().split())) for i in range(n)]
l = list(sorted(l,key=lambda x:x[1]))
c,m = [list(i) for i in zip(*l)]
ans = 9999
for i in range(n):
    if m[i] > t:
        break
    else:
        ans = min(ans,c[i])
if ans == 9999:
    print('TLE')
else:
    print(ans)

Solution (Python):
N,T=list(map(int,input().split()))
ans=float("inf")
for i in range(N):
   a,b=map(int,input().split())
   if T>=b:
      ans=min(ans,a)
print("TLE" if ans==float("inf") else ans)

Solution (Python):
n, t = map(int, input().split())
c = 10000
for i in range(n):
    tmp = input().split()
    if t >= int(tmp[1]):
        if int(tmp[0]) < c:
            c = int(tmp[0])
if c == 10000:
    print('TLE')
    exit()
else:
    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 and c < C:
    C = c
if C == 1001:
  print ('TLE')
else:
  print (C)

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    N, T = LI()
    ans = inf
    for i in range(N):
        c, t = LI()
        if t <= T:
            ans = min(ans, c)
    if ans == inf:
        print("TLE")
        return
    print(ans)

main()

Solution (Python):


N, T = map(int, input().split())
C_T = [map(int, input().split()) for _ in range(N)]
temp_c = 10**10
for c, t in C_T:
    if t <= T and c <= temp_c:
        temp_c = c


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

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

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

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

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

Solution (Python):
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    N, T = map(int, readline().split())
    ans = INF

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

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


if __name__ == '__main__':
    main()

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

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

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


if __name__ == "__main__":
    main()

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

    for _ in range(n):
        c, t = map(int, input().split())
        if t <= T:
            is_able = True
            if c < min_c:
                min_c = c

    if is_able:
        print(min_c)
    else:
        print("TLE")


if __name__ == "__main__":
    main()

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

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

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

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

c = []

for i in range(0,n):
    c_i, t_i = map(int, input().split())

    if t_i <= t:
        c.append(c_i)

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

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())
a = []
for i in range(n):
  c, s = map(int, input().split())
  if s <= t:
    a.append(c)
print("TLE" if len(a) == 0 else min(a))

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

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

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

Solution (Python):
n,t = map(int, input().split())
y = 10**5
c = [list(map(int,input().split())) for i in range(n)]
for i in range(n):
    if c[i][1]<=t:
        y=min(y,c[i][0])
if y != 10**5:
    print(y)
else:
    print("TLE")

Solution (Python):
n,t = map(int, input().split())
y = 10**5
c = [list(map(int,input().split())) for i in range(n)]
for i in range(n):
    if c[i][1]<=t:
        y=min(y,c[i][0])
if y != 10**5:
    print(y)
else:
    print("TLE")

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

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

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

res = 10000

for i in range(n):
    a,b = map(int, input().split())
    if b <= t:
        res = min(res,a)

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

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

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())
x = list()
cnt = 0
for i in range(n):
    c, t = map(int, input().split())
    if t <= T:
        x.append(c)
        cnt = 1
if cnt == 0:
    print("TLE")
else:
    print(min(x))

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

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

Solution (Python):


num, time = map(int, input().split())
count = 0
ans = 10000
for i in range(num):
    cost, tm = map(int, input().split())
    if tm <= time:
        if cost < ans:
            ans = cost
            max = ans
            count = 1
if count == 0:
    print("TLE")
else:
    print(ans)

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

ans = 0
for i in range(len(ct)):
  if ct[i][1] <= T:
    ans = ct[i][0]
    break
if ans == 0:
  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 l != []:
  print(min(l))
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:
        m=min(m,c)
        
print("TLE" if m==1001 else m)

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

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

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

import numpy as np

c = np.zeros(N)
t = np.zeros(N)

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

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

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

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

if res < 10 ** 9:
    print(res)
else:
    print("TLE")

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

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

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

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

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

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

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

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

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

cost = []

for c, t in ct:
    if t <= T:
        cost.append(c)

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

Solution (Python):


def main():
    N, T = map(int, input().split())
    l = []
    for _ in range(N):
        c, t = map(int, input().split())
        l.append((c, t))
    l.sort()
    for e in l:
        if e[1] <= T:
            print(e[0])
            return
    print("TLE")
        

if __name__ == "__main__":
    main()

Solution (Python):
n, t = map(int, input().split())
c_lists = []
t_lists = []
for i in range(n):
  c_i, t_i = map(int, input().split())
  c_lists.append(c_i)
  t_lists.append(t_i)

costs = []
for j in range(n):
    if t_lists[j] <= t:
        costs.append(c_lists[j])
if not costs:
    ans = 'TLE'
else:
    costs.sort()
    ans = costs[0]
print(ans)

Solution (Python):
N,T = map(int,input().split())
ct=[9999]
for _ in range(N):
    ctt= list(map(int,input().split()))
    if ctt[1]<=T:
        ct.append(ctt[0])
if ct==[9999]:
    print("TLE")
    exit()
print(min(ct))

Solution (Python):
import sys
import math


sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))

N,T = inm()
min_cost = 2000

for i in range(N):
    c,t = inm()
    if t <= T:
        min_cost = min(min_cost,c)

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

Solution (Python):
import sys
def MI(): return map(int,sys.stdin.readline().rstrip().split())

N,T = MI()

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

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

cost = []

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

if len(cost) > 0:
    print(min(cost))
else:
    print("TLE")

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

Solution (Python):
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N, T = map(int, readline().split())

    ans = INF
    for _ in range(N):
        c, t = map(int, readline().split())
        if t <= T and ans > c:
            ans = c
    
    if ans < INF:
        print(ans)
    else:
        print('TLE')
    return


if __name__ == '__main__':
    main()

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

Solution (Python):
N,T = map(int, input().split())
l = []
for _ in range(N):
    c,t = map(int, input().split())
    if T >= t:
        l.append(c)
    else:
        l.append(1001)

print(min(l)) if min(l) < 1001 else print("TLE")

Solution (Python):
n,T = map(int,input().split())
ct = [list(map(int,input().split())) for _ in range(n)]
li = []
for k in ct:
    if k[1]<=T:
        li += [k[0]]
if li ==[]:
    print("TLE")
else:
    print(min(li))

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

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

print(ans)

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

Solution (Python):









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

costs = []
for i in range(n):
    if l[i][1] <= t:
        costs.append(l[i][0])

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

Solution (Python):
N,T=map(int,input().split())
cost=1000000
num=-1
for i in range(N):
  c,t=map(int,input().split())
  if t<=T and cost > c:
    cost = c
    num = i+1
print(cost if num > 0 else 'TLE')

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

z = zip(c, t)
z = sorted(z)
c, t = zip(*z)

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

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

ans = 1001
for c, t in CT:
    if t > T: continue
    ans = min(ans, c)
if ans == 1001:
  ans = "TLE"
print(ans)

Solution (Python):
import sys


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


def main():
    n, T = nm()
    C = []
    for _ in range(n):
        c, t = nm()
        if t <= T:
            C.append(c)
    print(min(C) if C else 'TLE')


if __name__ == '__main__':
    main()

Solution (Python):
n,t = map(int,input().split())
c = []
for _ in range(n):
    c1,t1 = map(int,input().split())
    if t1 <= t:
        c.append(c1)
if len(c) == 0:
    print("TLE")
else:
    c.sort(key=int)
    print(c[0])

Solution (Python):
n,t = map(int,input().split())
c = []
for i in range(n):
    c1,t1 = map(int,input().split())
    if t1 <= t:
        c.insert(i,c1)
if len(c) == 0:
    print("TLE")
else:
    c.sort(key=int)
    print(c[0])

Solution (Python):
n, timelimit = map(int, input().split() )
ans = 1001
for i in range (n):
  cost, time = map(int, input().split() )
  if time <= timelimit:
    ans = min(ans, cost)
print (ans if ans <= 1000 else "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(ans if ans < float('inf') else 'TLE')

Solution (Python):
n, t = map(int, input().split())
res = 1000 + 1
for i in range(n):
    ci, ti = map(int, input().split())
    if ti <= t:
        res = min(res, ci)

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

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

a = 10**19
for _ in range(n):
    c, tt = map(int, input().split())
    if t >= tt:
        a = min(c, a)

if a == 10**19:
    print('TLE')
else:
    print(a)

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

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

dic = {}
for i in range(n):
    a,b = map(int, input().split())
    dic[a] = b

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

for i,j in dic:
    if j <= t:
        print(i)
        exit()
print('TLE')

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

Solution (Python):
N,T=map(int,input().split())
INF=float("inf")
ans=INF
for _ 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())
min_cost = int(1e9)+11
flg = False
for i in range(N):
    c, t = map(int, input().split())
    if t <= T:
        flg = True
        min_cost = min(min_cost, c)
if flg:
    print(min_cost)
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(ans)
else:
    print('TLE')

Solution (Python):
N, T = list(map(lambda x : int(x), input().split(" ")))
cand = []
for i in range(N):
  c, t = list(map(lambda y : int(y), input().split(" ")))
  if t <= T:
    cand.append(c)

if len(cand) > 0:
  print(min(cand))
else:
  print("TLE")

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

def main():
    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(ans if ans <= 1000 else 'TLE')
    
if __name__ == '__main__':
    main()

Solution (Python):
if __name__ == '__main__':

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

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

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

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

for j in range(len(l_c)):
    if l_c[j] == min(l_c):
        print(l_c[j])
        exit()

print('TLE')