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,time=(map(int,input().split()))
c=[]
t=[]
for i in range(n):
    C,T=map(int,input().split())
    c.append(C)
    t.append(T)


if min(t)>time:
    print("TLE")
else:
    for i in range(len(t)):
        if t[i]>time:
            c[i]=max(c)


    
    if len(c)==1:
        print(c[0])
    elif len(c)==2:
        if c[0]>=c[1]:
            print(c[1])
        else:
            print(c[0])
    else:
        print(min(c))

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

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

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

def resolve():
    n,t=map(int, input().split())
    costl=[]
    for i in range(n):
        c,tt=map(int, input().split())
        if tt<=t:
            costl.append(c)
    if len(costl)==0:
        print('TLE')
    else:
        print(min(costl))
resolve()

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

def resolve():
    n,t=map(int, input().split())
    costmin=10000
    for i in range(n):
        c,tt=map(int, input().split())
        if tt<=t:
            costmin=min(c,costmin)
    if costmin==10000:
        print('TLE')
    else:
        print(costmin)
resolve()

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

min_cost = 10000000

for n in range(N):
  cost, time = map(int, input().split())
  if time <= T:
    if cost < min_cost:
      min_cost = cost
if min_cost == 10000000:
  print("TLE")
else:
  print(min_cost)

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

ans = float('inf')
for _ in range(N):
    cost, elapsed_time = map(int, input().split())
    if elapsed_time <= T:
        ans = min(ans, cost)
print(ans) if ans != float('inf') else print('TLE')

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

Solution (Python):
import sys

input = sys.stdin.readline


def main():
    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())

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

    if ans == float("inf"):
        ans = "TLE"

    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
n,tmax=map(int,input().split())
c=[0]*n
t=[0]*n
result=9999
for i in range(0,n):
  c[i],t[i]=map(int,input().split())
  if t[i]<=tmax and c[i]<result:
    result=c[i]
if result==9999:
  print("TLE")
else:
  print(result)

Solution (Python):
N, T = list(map(int,input().split()))
L1 = [list(map(int,input().split())) for _ in range(N)]
L2 = []
for i in L1:
    if i[1] <= T:
        L2.append(i)
if len(L2) == 0:
    print('TLE')
else:
    cost = []
    for i in L2:
        cost.append(i[0])
    print(min(cost))

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

min_cost = 10000

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

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

Solution (Python):
import itertools
import math
import fractions
import functools
n, t = map(int, input().split())
pair = []
for i in range(n):
    ci, ti = map(int, input().split())
    pair.append([ci, ti])

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

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

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

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

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

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

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

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

for i in range(n):
    if sorted_by_cost[i][1] <= t:
        print(sorted_by_cost[i][0])
        exit()
print('TLE')

Solution (Python):
inf = 10**15
mod = 10**9+7
n,T = map(int, input().split())
minc = inf
for i in range(n):
    c,t = map(int, input().split())
    if t <= T:
        minc = min(minc, c)
if minc == inf:
    print('TLE')
else:
    print(minc)

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

mi=10**9

for _ in range(n):
    c,tt=map(int,input().split())

    if tt<=t:
        mi=min(mi,c)

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

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

found = False
min_cost = float("inf")
for i in range(N):
    c, t = map(int, input().split())
    if t <= T and c < min_cost:
        min_cost = c
        found = True
print(min_cost if found else "TLE")

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

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())
min_cost = 10**9
for i in range(N):
    c,t = map(int, input().split())
    if T >= t and min_cost > c:
        min_cost = c
if min_cost == 10**9:
    print("TLE")
    exit()
print(min_cost)

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

c_init = 10 ** 4
ans = c_init
for _ in range(n):
    c, t = [int(x) for x in input().split()]
    if (t <= tl) and (c < ans):
        ans = c
if ans == c_init:
    ans = "TLE"
print(ans)

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

temp_list = []
for _ in range(n):
    c, t = [int(x) for x in input().split()]
    if t <= tl:
        temp_list.append(c)
temp_list.sort()
if len(temp_list) == 0:
    ans = "TLE"
else:
    ans = temp_list[0]
print(ans)

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

Solution (Python):

n,t = map(int,input().split())
ct = [list(map(int,input().split())) for i in range(n)]
min_cost = float("inf")
cnt = 0
for i in range(n):
  if ct[i][1] <= t:
    min_cost = min(min_cost,ct[i][0])
    cnt += 1
if cnt != 0:
  print(min_cost)
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)
if ans==1001:
  print('TLE')
else:
  print(ans)

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

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

for i in range(N):
  t1, t2 = map(int, input().split())
  if t2 <= T and (t1 < res or res < 0):
    res = t1

if res >= 0:
  print(res)
else:
  print("TLE")

Solution (Python):
N, T = map(int, input().split())
CT = []
res = -1

for i in range(N):
  t1, t2 = map(int, input().split())
  CT.append([t1, t2])

for ct in CT:
  if ct[1] <= T and (ct[0] < res or res < 0):
    res = ct[0]

if res >= 0:
  print(res)
else:
  print("TLE")

Solution (Python):
n,T = map(int,input().split())
cands = [tuple(map(int,input().split())) for _ in range(n)]
cands.sort()
for c,t in cands:
  if t<= T:
    print(c)
    break
else:
  print('TLE')

Solution (Python):
n, t = map(int, input().split())
cmin = 10**10
for i in range(n):
  c, ti = map(int, input().split())
  if ti > t:
    continue
  cmin = min(cmin, c)
if cmin == 10**10:
  print('TLE')
else:
  print(cmin)

Solution (Python):




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


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

if __name__ == "__main__":
    main()

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

Solution (Python):
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

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

ans = min(map(lambda t: t[0], filter(lambda t: t[1] <= T, [list(map(int, input().split())) for _ in range(N)] + [[1 << 28, 0]])))

print(ans if ans != 1 << 28 else "TLE")

Solution (Python):
n,T=map(int,input().split())
data=[input().split() for i in range(n)]
lc=[]
for row in data:
    if int(row[1]) <=T:
        lc.append(row[0])
ls=[int(j) for j in lc]

if not lc:
    print("TLE")
else:
    print(min(ls))

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

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

Solution (Python):
n, limit = map(int, input().split())
cost = list()
for _ in range(n):
  c, time = [int(a) for a in input().split()]
  if time <= limit:
    cost.append(c)
print(min(cost) if len(cost) > 0 else 'TLE')

Solution (Python):

import sys
try:
    from typing import List
except ImportError:
    pass


def solve(N: int, T: int, c: "List[int]", t: "List[int]"):
    try:
        print(min(ci for ci, ti in zip(c, t) if ti <= T))
    except ValueError:
        print("TLE")


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


if __name__ == '__main__':
    main()

Solution (Python):


n, T = map(int, input().split())
Min = -1
for i in range(n):
    c, t = map(int, input().split())
    if t <= T:
        if Min == -1:
            Min = c
        else:
            Min = min(Min, c)
if Min == -1:
    print('TLE')
else:
    print(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:
        ans=min(ans,a)

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

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

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil
from operator import itemgetter
from copy import deepcopy
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
inf = 10**17
mod = 10**9 + 7

n,t=MI()
costs=[]
for i in range(n):
    c,ti=MI()
    if ti<=t:
        costs.append(c)
if len(costs)==0:
    print("TLE")
else:
    costs.sort()
    print(costs[0])

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())
idx = []
ans = 1000
for i in t:
    if i <= T:
        idx.append(t.index(i))
if len(idx) == 0:
    print("TLE")
    exit()
else:
    for i in idx:
        if ans > c[i]:
            ans = c[i]
print(ans)

Solution (Python):
n,t=map(int,input().split())
keepcost=10**10
for i in range(0,n):
  c,tt=map(int,input().split())
  if tt<=t:
    if c<keepcost:
      keepcost=c
print([keepcost,"TLE"][keepcost==10**10])

Solution (Python):
n,t=map(int,input().split())
res=10**5
for i in range(n):
    a,b=map(int,input().split())
    if b <= t:
        res=min(res,a)
    else:
        continue

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

Solution (Python):
n, t = map(int, input().split())
ct = []
for i in range(n):
    c, time = map(int, input().split())
    ct.append([c, time])
min_t = t
cost = float('inf')
cnt = 0
for i in range(n):
    if ct[i][1] > t:
        cnt += 1
    else:
        if cost >= ct[i][0]:
            min_t = ct[i][1]
            cost = ct[i][0]
if cnt == n:
    print('TLE')
else:
    print(cost)

Solution (Python):
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for _ in range(N)]
def dp2(ini, i, j): return [[ini]*i for _ in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for _ in range(j)] for _ in range(k)]
import bisect 



N, T = mi()
ct = li2(N)

ans = float('inf')

for i in range(N):
    if ct[i][1] > T:
        continue
    if ct[i][0] < ans:
        ans = ct[i][0]

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

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

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

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

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

ct.sort()
jdg = False

for i in range(N):
    if ct[i][1] <= T:
      jdg = True
      break
    
print(ct[i][0] if jdg else 'TLE')

Solution (Python):
N, T = map(int, input().split())
c_t = []
for _ in range(N):
    _c, _t = map(int, input().split())
    c_t.append((_c, _t))

for a in sorted(c_t):
    if a[1] <= T:
        print(a[0])
        break
else:
    print("TLE")

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

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

res = "TLE"
cts = sorted(ct)
for i in cts:
    if i[1] > t:
        pass
    else:
        res = i[0]
        break
print(res)

Solution (Python):
n,T = list(map(int,input().split()))
ans = 10000
for i in range(n):
  c,t = map(int,input().split())
  if(t<=T):
    ans=min(ans,c)
  else:
    None
if(ans == 10000):
  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(c, ans)
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)]
ans=10**8
for i in ct:
    if i[1]<=t:
        ans=min(ans,i[0])
if ans==10**8:
    print("TLE")
else:
    print(ans)

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

ans = 0
min_t = 10000
for i in range(n):
    c,s = map(int,input().split())
    if s <= t and c<=min_t:
        min_t = min(c,min_t)
        ans = c
    
if min_t == 10000:
    print("TLE")
else:
    print(ans)

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

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

Solution (Python):
n,t=map(int,input().split())
ans=10000000000000000
for i in range(n):
    a,s=map(int,input().split())
    if s<=t:ans=min(ans,a)
print(ans if 10000000000000000!=ans else "TLE")

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

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

judge = False
cost = list()
for a in range(N):
    c, t = map(int, input().split())
    if t <= T:
        cost.append(c)
        judge = True

if judge:
    print(min(cost))
else:
    print('TLE')

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

Solution (Python):

import sys
import numpy as np

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N, T = lr()
CT = np.array([lr() for _ in range(N)])
CT = CT[CT[:, 1] <= T]
time = CT[:, 0]
if len(time) == 0:
    print('TLE')
else:
    answer = time.min()
    print(answer)

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

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

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

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

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())
c = 0
for _ in range(N):
  _c, _t = map(int,input().split())
  if _t <= T:
    if c == 0:
      c = _c
    elif c != 0 and _c <= c:
      c = _c
print(c if c != 0 else "TLE")

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

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

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

answer = minimum if minimum < 1001 else 'TLE'

print(answer)

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

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

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N, T = MAP()
ct = [LIST() for _ in range(N)]

c = 1001

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

print("TLE" if c == 1001 else c)

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

Solution (Python):
N, T = map(int, input().split())
List = []
List2 = []
min = 1001

for i in range(N):
    M, B = map(int, input().split())
    List.append([M,B])
    M, B = 0, 0

for k in range(N):
    if int(List[k][1]) <= T:
        List2.append(List[k])

for n in range(len(List2)):
    if List2[n][0] <= min:
        min = List2[n][0]

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

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

Solution (Python):
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    

    
    

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

if __name__ == '__main__':
    main()

Solution (Python):

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

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

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

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

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

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

Solution (Python):
n, T = map(int, input().split())
root = []
for i in range(n):
    c,t = map(int, input().split())
    if T >= t:
        root.append(c)
if root == []:
    print("TLE")
else:
    sort_root = sorted(root)
    print(sort_root[0])

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

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

if ct == []:
  print("TLE")
else:
  ct.sort()
  print(ct[0][0])

Solution (Python):
N,T=map(int, input().split())
minC = 1000
minT = T+1
for i in range(N):
  c,t=map(int, input().split())
  if t<minT:
    minT = t
  if t<=T and c<minC:
    minC = c

if minT<=T:print(minC)
else: print("TLE")

Solution (Python):
a,b = map(int,input().split())
ans ="TLE"
ans_list = []
for _ in range(a):
  c,d = map(int,input().split())
  if b >= d:
    ans_list.append(c)

if len(ans_list) != 0:
  ans = min(ans_list)
print(ans)

Solution (Python):
N, L =map(int, input().split())
cost = 1001
count = 0
for i in range(N):
  c, t =map(int, input().split())
  if t <= L:
    if c < cost:
      cost = c
      count += 1
  elif t > L:
    continue;
if count == 0:
  print("TLE")
else:
  print(cost)

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

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

ans = 1001
for c,t in ct:
    if t <= T and ans > c:
        ans = c

print(ans if ans <= 1000 else "TLE")

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

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

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

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

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

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

Solution (Python):
def main():
    N, T = (int(i) for i in input().split())
    CT = [[int(i) for i in input().split()] for j in range(N)]
    CT.sort()
    for c, t in CT:
        if t <= T:
            return print(c)
    print("TLE")


if __name__ == '__main__':
    main()

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

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

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

Solution (Python):
def main():
    n, max_t = map(int, input().split())
    max_val = 10 ** 9 + 7
    answer = max_val
    for _ in range(n):
        c, t = map(int, input().split())
        if t <= max_t:
            answer = min(answer, c)
    print(answer if answer != max_val else "TLE")


if __name__ == '__main__':
    main()

Solution (Python):
def solve():
    n,t = map(int,input().split())
    mn = 10**9
    ans = False
    for _ in range(n):
        a,b = map(int,input().split())
        if b<=t:
            mn = min(mn,a)
            ans = True
    if ans:
        print(mn)
    else:
        print('TLE')
if __name__=='__main__':
    solve()

Solution (Python):

from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.buffer.readline().split()]
def I(): return int(sys.stdin.buffer.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    n,t = LI()
    g = LIR(n)
    g = [i for (i,j) in g if j <= t]
    if not g:
        print("TLE")
    else:
        print(min(g))
    return


if __name__ == "__main__":
    solve()

Solution (Python):
import sys
def main():
    input = sys.stdin.readline
    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)
    print(ans if ans < 10**10 else 'TLE')

if __name__ == '__main__':
    main()