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=[list(map(int,input().split())) for i in range(N)]
ans=10**4
for i in range(N):
  if c[i][1]<=T:
    ans=min(ans,c[i][0])
if ans==10**4:
  ans='TLE'
print(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)

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

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

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

Solution (Python):
import sys
import math
import itertools
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7

N,T = I()
ans = 10**9
for i in range(N):
    c,t = I()
    if t > T:
        continue
    ans = min(ans,c)
if ans == 10**9:
    ans = 'TLE'
print(ans)

Solution (Python):
N, T = map(int, input().split())
c_t = [list(map(int, input().split())) for _ in range(N)]
cost = 2000000
TLE_flg = True
for i in range(N):
    if c_t[i][1] <= T:
        cost = min(cost, c_t[i][0])
        TLE_flg = False
print('TLE' if TLE_flg else cost)

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

if cc == []:
    print('TLE')
    exit()

print(min(cc))

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

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

data = []

for i in range(n):
    tmp = input().split()
    tmp[0] = int(tmp[0])
    tmp[1] = int(tmp[1])
    data.append(tmp)

data.sort()


flg = False
for i in range(len(data)):
    if data[i][1] <= t:
        print(data[i][0])
        flg = True
        break

if not flg:
    print("TLE")

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

Solution (Python):
ans = 10**10
n,time = map(int,input().split())
for i in range(n):
    c,t = map(int,input().split())
    if t<=time and c<ans:
        ans = c
print('TLE' if ans==10**10 else ans)

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

Solution (Python):
N , T = map(int,input().split())
ans = 10**4
for i in range(N):
    c , t = map(int,input().split())
    if t <= T:
        ans = min(c,ans)
if ans == 10**4:
    print("TLE")
else:
    print(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())
ans=1000000
for i in range(N):
    c,t=map(int,input().split())
    if(t<=T):
        ans=min(ans,c)
if(ans==1000000):
    print("TLE")
else:
    print(ans)

Solution (Python):
def actual(N, T, C, t_list):
    if all([t > T for t in t_list]):
        return 'TLE'

    m = 1000

    for c, t in zip(C, t_list):
        if t <= T:
            m = min(m, c)

    return m

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

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

print(actual(N, T, C, t_list))

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

for j in range(n):
    if j in re:
        continue
    else:
        l.append(c[j])

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

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

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

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

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

Solution (Python):
def mi():
    return map(int, input().split())

def main():
    N, T = mi()
    ct = [map(int, input().split()) for _ in range(N)]
    c, t = [list(i) for i in zip(*ct)]
    m = 10**100
    bl = False
    for i in range(N):
        if t[i] <= T:
            m = min(m, c[i])
            bl = True
    print(m if bl else 'TLE')


if __name__ == '__main__':
    main()

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

ct.sort(key=lambda x: x[1])
ans = 10**18

for c,t in ct:
  if t > T:
    break
  ans = min(ans,c)
if ans == 10**18:
  ans = 'TLE'
print(ans)

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

d.sort()

if len(d) == 0:
    print("TLE")

else:
    print(d[0])

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

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

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

Solution (Python):
import math
def ip():return int(input())
def imp():return map(int,input().split())

n,t=imp()
ans=10**18
for _ in range(n):
    c,d=imp()
    if d<=t:
        ans=min(ans,c)
if ans==10**18:print("TLE")
else:print(ans)

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

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

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

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

cost_min = 1e9

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

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

Solution (Python):





def main():
    N, T = map(int, input().split())
    c = [None] * N
    t = [None] * N
    for i in range(N):
        c[i], t[i] = map(int, input().split())

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

    if len(costs) == 0:
        return "TLE"
    
    return min(costs)


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

Solution (Python):
def resolve():
    N, T = map(int, input().split())
    c = []
    t = []
    for _ in range(N):
        ca, ta = map(int, input().split())
        c.append(ca)
        t.append(ta)
    ans = []
    for i in range(N):
        if t[i] <= T:
            ans.append(c[i])
    if len(ans) != 0:
        print(c[c.index(min(ans))])
    else:
        print("TLE")
resolve()

Solution (Python):

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

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

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

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

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

Solution (Python):

N, T = map(int,input().split())
C = [map(int,input().split()) for i in range(N)]
ans = 10001
for c,t in C:
    if t <= T and ans > c:
        ans = c
if ans <1001:
    print(ans)
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(ans if ans != float("inf") 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(l == []):
  print("TLE")
else:
  print(min(l))

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])
if all(CT[i][1] > t for i in range(n)) == True:
  print("TLE")
else:
  print(min(C))

Solution (Python):
import sys, math, itertools, collections, bisect 
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8') 
inf = float('inf') ;mod = 10**9+7 
mans = inf ;ans = 0 ;count = 0 ;pro = 1

n, T = map(int, input().split())
cost = False
for i in range(n):
    c, t = map(int, input().split())
    if t > T:
        pass
    else:
        if cost == False:
            cost = c
        else:
            if cost > c:
                cost = c
if cost == False:
    print("TLE")
else:
    print(cost)

Solution (Python):

if __name__ == '__main__':
    b, c = map(int, input().split())

    min = 9999
    for i in range(b):
        a = [int(i) for i in input().split()]
        if  a[1]<= c and a[0] < min:
            min = a[0]

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

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

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

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

mxc=max(c)
for i in range(n):
  if t[i]>T:
    c[i]=mxc+1

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

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

Solution (Python):


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

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

dic = {}
for i in range(N):
    c,t = map(int,input().split())
    dic[c] = t
list = []
for key, value in dic.items():
    if value <= T:
        list.append(key)

if len(list) > 0:
    print(min(list))
else:
    print('TLE')

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

Solution (Python):
import sys, re
from math import ceil, floor, sqrt, pi, factorial
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left
from functools import reduce
from decimal import Decimal, getcontext

def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_list(N): return [s_list() for _ in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7

def main():
    n, t = i_map()
    num_list = i_row_list(n)

    min_cost = INF

    for cost, time in num_list:
        if time > t:
            continue
        min_cost = min(min_cost, cost)

    print(min_cost if min_cost != INF else 'TLE')

if __name__ == '__main__':
    main()

Solution (Python):
n,T =map(int, input().split())
ans = 10**5
for _ in range(n):
    c,t=map(int, input().split())
    if t > T:
        continue
    ans = min(ans,c)
if ans == 10**5:
    print("TLE")
else:
    print(ans)

Solution (Python):
N,T = map(int,input().split())
CT = []
for n in range(N):
  c,t = map(int,input().split())
  CT.append([c,t])
CT = sorted(CT,key=lambda x: x[0])
ans = True
for ct in CT:
  if ct[1] <= T:
    print(ct[0])
    ans = False
    break
if ans:
  print("TLE")

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)

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

Solution (Python):
n,T = map(int,input().split())
ans = 10000
count = 0
for i in range(n):
    c,t = map(int,input().split())
    if t <= T and ans > c:
        ans = c
        count += 1
if count == 0:
    print("TLE")
else:
    print(ans)

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 and ans > c:
        ans = c

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

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

ans = 100000000000000
for i in range(n):
    x, y = map(int,input().split())
    if y > t:
        continue
    else:
        if ans > x:
            ans = x


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

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

for i in range(N):
    C.append([int(i) for i in input().split()])

x = T
res = []

for c in C:
    cost = c[0]
    time = c[1]
    if time <= x:
        res.append(cost)
    

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

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

min_c = 1000
b = False

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

print(min_c if b else 'TLE')

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

x = None
for i in range(N):
    c, t = map(int, input().split())
    if t <= T:
        x = c if x is None or x > c else x

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

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

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

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

Solution (Python):
N,T = list(map(int,input().split()))
CT = []
for i in range(N):
    CT.append(list(map(int,input().split())))
out = 10**5
ind = N
for i in range(N):
    if CT[i][1]<=T and CT[i][0]<out:
        out = CT[i][0]
        ind = i
if ind==N:
    print("TLE")
else:
    print(out)

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

ct = [0]*n

for i in range(0,n):
  ct[i] = input().split()
  
s = []
for i in range(0,n):
  if(int(ct[i][1]) <= t):
    s.append(int(ct[i][0]))
if(len(s) != 0):
  print(min(s))
else:
  print("TLE")

Solution (Python):
n,t=map(int,input().split())
x=1234
for i in range(n):
  c,d=map(int,input().split())
  if d<=t:
    if c<=x:
      x=c
if x==1234:
  print('TLE')
else:
  print(x)

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

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

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

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

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

Solution (Python):

import sys
input = sys.stdin.readline









N,T = map(int,input().split())
CT = [tuple(map(int,input().split())) for _ in range(N)]

INF = float("inf")
ans = INF
for c,t in CT:
    if t <= T and c < ans:
        ans = c

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

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

Solution (Python):
N, T = map(int, input().split())
result = []
for i in range(N):
  c, t = map(int, input().split())
  if T >= t:
    result.append([c,t])
print((sorted(result, key=lambda x:x[0])[0][0]) if result else 'TLE')

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

ct.sort(key=lambda val : val[0])
ans = 0
for i in range(n):
    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())
ans=[]
for i in range(n):
    a,b=map(int,input().split())
    if b<=t:
        ans.append(a)
if ans==[]:
    print("TLE")
else:
    print(min(ans))

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

for c, t in ct:
    if t <= T:
        mx = min(mx, c)

if mx != float('inf'):
    print(mx)
    exit()
print('TLE')

Solution (Python):
n,t = map(int, input().split())
min_ = 10**18
for i in range(n):
  c,t2 = map(int, input().split())
  if t>=t2:
    min_ = min(min_, c)
if min_ == 10**18:
  print("TLE")
else:
  print(min_)

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

ans = float('inf')
for i in range(N):
  if t[i] <= T and c[i] < ans:
    ans = c[i]
if ans == float('inf'):
  print('TLE')
else:
  print(ans)

Solution (Python):

N, T = map(int, input().split())
rhr = []
r_append = rhr.append
for i in range(1, N + 1):
    c, t = map(int, input().split())
    r_append(
        {
            "index": i,
            "cost": c,
            "time": t
        }
    )

target_routes = [
    r
    for r in rhr
    if r["time"] <= T
]

if not target_routes:
    print("TLE")
else:
    target_routes.sort(key=lambda x: x["cost"])
    print(target_routes[0]["cost"])

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

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


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



if __name__ == "__main__":
    main()

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

for i in range(1,N+1):
  c, t = map(int, input().split())
  arrc.append(c)
  arrt.append(t)

if min(arrt) > T:
  print("TLE")
else:
  ans = arrc[0]
  for i in range(0,N):
    if arrt[i] <= T:
      if arrc[i] < ans:
        ans = arrc[i]
  print(ans)

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

Solution (Python):

n,m = map(int, input().split())
cost, time = 10000, 10000
for i in range(n):
    c,t = map(int, input().split())
    
    if m >= t:
            cost = min(cost,c)
            
if cost == 10000:
    print('TLE')
else:
    print(cost)

Solution (Python):
def resolve():
    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)
    
if __name__ == '__main__':
    resolve()

Solution (Python):


N, T = map(int, input().split())
INF = 10**18
min_cost = INF
for i in range(N):
    c, t = map(int, input().split())
    if t <= T:
        min_cost = min(min_cost, c)

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

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

Solution (Python):
n, t = map(int, input().split())
ct = sorted([list(map(int, input().split())) for _ in range(n)], key=lambda x:x[0])
for c, t_ in ct:
    if t_ <= t:
        print(c)
        exit()
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())
ct=[]
ans=[]
for i in range(n):
    ct=[int(x) for x in input().split()]
    if ct[1] <=t:
        ans.append(ct[0])
if ans==[]:
    print("TLE")
else:
    print(min(ans))

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"):
    ans = "TLE"

print(ans)

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

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

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

Solution (Python):
n, t = map(int, input().split())
apple = [list(input().split()) for _ in range(n)]
orange = []
for i, j  in zip(apple, range(n)):
    if int(apple[j][1]) <= t:
        orange.append(int(apple[j][0]))
    else:
        pass
print(min(orange) if len(orange) > 0 else "TLE")

Solution (Python):
n, t = map(int, input().split())
C = []
a = 0
for i in range(n):
    c, time = map(int, input().split())
    if time <= t:
        C.append(c)
    else :
        a += 1
C.sort()
print('TLE' if a == n else C[0])

Solution (Python):
MIN = 100000

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

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

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

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

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

Solution (Python):
def solve():
    N, T = map(int, input().split())
    A = [list(map(int, input().split())) for _ in range(N)]
    A.sort()
    for c,t in A:
        if t<=T:
            return c
    return 'TLE'
print(solve())

Solution (Python):


import sys
input= lambda: sys.stdin.readline().rstrip()
def pin(type=int):return map(type,input().split())
def tupin(t=int):return tuple(pin(t))

def resolve():
    N,K=pin()
    c=[tupin() for i in range(N)]
    C=sorted(filter(lambda x:x[1]<=K,c))
    try:
        print(C[0][0])
    except :print("TLE")

resolve()

Solution (Python):
import itertools
import math
import fractions
import functools
import copy

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

cost = 10**10
for i in range(N):
    if t[i] <= T:
        cost = min(cost,c[i])
if cost == 10**10:
    print("TLE")
else:print(cost)

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

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

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

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

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

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

Solution (Python):
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce
from fractions import gcd
import sys
def input(): return sys.stdin.readline().rstrip()
def I(): return int(input())
def Is(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()
def LS(): return list(input())
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(10**6)
MOD = 10**9+7
INF = 10**18


n, T = Is()
CT = TIR(n)
ans = INF
for c, t in CT:
    if t <= T:
        ans = min(ans, c)
if ans == INF:
    print('TLE')
else:
    print(ans)

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

Solution (Python):
import sys
import math
import bisect

def main():
    n, m = map(int, input().split())
    A = []
    for i in range(n):
        a, b = map(int, input().split())
        if b <= m:
            A.append(a)
    if len(A) == 0:
        print('TLE')
    else:
        print(min(A))

if __name__ == "__main__":
    main()

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

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

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:
    costs.sort()
    ans = costs[0]
else:
    ans = 'TLE'
print(ans)

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

cost = float(10000)
for a in a:
    if a[1] <= t and a[0] < cost:
        cost = a[0]

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

Solution (Python):
n,t = map(int,input().split())
ans = 10000
for i in range(n):
    cost,time = map(int,input().split())
    if time <= t and cost < ans:
        ans = cost
if ans == 10000:
    ans = "TLE"
print(ans)

Solution (Python):
n, t = map(int, input().split())
INF = 10**10
min_c = 10**10
for _ in range(n):
    ci, ti = map(int, input().split())
    if ti > t:
        continue
    min_c = min(ci, min_c)
if min_c == INF:
    print('TLE')
    exit()
print(min_c)

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

Solution (Python):
N, T = map(int, input().split())
ans = float('inf')
flag = False
for i in range(N):
    c, t = map(int, input().split())
    if t <= T:
        ans = min(ans, c)
        flag = True

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

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