CodeEff/ECCO huggingface dataset:
# Original solution
n = int(eval(input()))
c = []
for i in range(1,n+1):
    k = []
    for j in range(1,i+1):
        if i % j == 0:
            k.append(j)

    if len(k) == 8:
        if i % 2 != 0:
            c.append(i)
print((len(c)))

# Optimized solution
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return len(divisors)
n = int(eval(input()))
ans = 0
for i in range(1,n+1,2):
    if make_divisors(i) == 8:
        ans += 1
print(ans)
# Original solution
def is8DivisorNumbers(n: int) -> bool:
    cnt = 0
    for i in range(1, n+1):
        if n%i == 0:
            cnt += 1

    return True if cnt == 8 else False

n = int(eval(input()))
odds = [i for i in range(1, n+1, 2)]

ans = 0
for odd in odds:
    if is8DivisorNumbers(odd):
        ans += 1

print(ans)


# Optimized solution
n = int(eval(input()))

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    return divisors

ans = 0
for i in range(1, n+1, 2):
    if len(make_divisors(i)) == 8:
        ans += 1

print(ans)
# Original solution
n = int(eval(input()))
cnt = 0
for i in range(1, n + 1):
    cnt2 = 0
    for j in range(1, i + 1):
        if i % j == 0 and i % 2 != 0:
            cnt2 += 1
    if cnt2 == 8:
        cnt += 1
print(cnt)


# Optimized solution
n = int(eval(input()))
cnt_t = 0
for i in range(1, n + 1, 2):
    cnt = 0
    t = i
    for j in range(1, t + 1):
        if t % j == 0:
            cnt += 1
    if cnt == 8:
        cnt_t += 1
print(cnt_t)
# Original solution
from bisect import bisect_right
print((bisect_right([105,135,165,189,195],int(eval(input())))))

# Optimized solution
n=int(eval(input()))
L=[105,135,165,189,195]
print((len(list([x for x in L if x<=n]))))
# Original solution
#python3
from math import floor, sqrt

def f(x):
    p = set()
    for i in range(1, floor(sqrt(x))+1):
        if x%i == 0:
            p.add(i)
            p.add(x//i)
    return len(p)
def main():
    n = int(eval(input()))
    cnt = 0
    for i in range(1, n+1):
        if i%2 != 0:
            if f(i) == 8:
                cnt += 1
    print(cnt)
main()

# Optimized solution
#python3

def div(x):
    a = []
    i = 1
    while i*i<x:
        if x%i == 0:
            a.append(x//i)
            a.append(i)
        i+=1
    n = len(a)
    return n 

def main():
    n = int(eval(input()))
    c = 0
    for i in range(1, n+1):
        if (i%2 != 0) and (div(i) == 8):
            c += 1
    print(c)
main()
# Original solution
n = int(eval(input()))
cnt =  0
ans = 0

ans = 0

for i in range(1, n+1,2):
    cnt = 0
    for j in range(1, n+1):
        if i % j == 0:
            cnt += 1
    if cnt == 8:
        ans += 1
print(ans)





# Optimized solution
N = int(eval(input()))

def make_divisor(n):
    divisors = []
    for i in range(1, int(n**.5) + 1):
        if n%i == 0:
            divisors.append(i)
            if i != n//i:
                divisors.append(n//i)
    divisors.sort()
    return divisors
cnt = 0
for i in range(1, N+1):
    if len(make_divisor(i)) == 8 and  i%2 == 1:
        cnt += 1
print(cnt)
# Original solution
# -*- coding: utf-8 -*-

N = int(eval(input()))
count = 0

for i in range(1, N + 1):
    a = []
    all_odd = 0
    for j in range(1, i + 1):
        if i % j == 0:
            a.append(j)
    for k in a:
        if k % 2 == 0:
            all_odd += 1
    if all_odd == 0 and len(a) == 8:
        count += 1

print(count)

# Optimized solution
# -*- coding: utf-8 -*-

N = int(eval(input()))
count = 0

for i in range(1, N + 1):
    a = []
    if i % 2 == 0:
        continue

    for j in range(1, i + 1):
        if i % j == 0:
            a.append(j)

    if len(a) == 8:
        count += 1

print(count)
# Original solution
n=int(eval(input()))
odd_list=list(range(1,n+1,2))
#print(odd_list)
cnt=0
for i in odd_list:
    ind=0
    temp=0
    while True:
        if ind>=len(odd_list):break
        if i<odd_list[ind]:break
        if i%odd_list[ind]==0:temp+=1
        ind+=1
    if temp==8:
        cnt+=1
#print(odd_list)
print(cnt)

# Optimized solution
n=int(eval(input()))
ans=0
for i in range(1,n+1,2):
    num=int(i**0.5)
    cnt=0
    for j in range(1,num+1):
        if i%j==0:
            cnt+=2
    if cnt==8:
        ans+=1
print(ans)
# Original solution
N = int(eval(input()))
result = 0

for i in range(1, N+1):
    count = 0
    for j in range(1, i+1):
        if i % j == 0:
            count += 1
    if i%2 == 1 and count == 8:
        result += 1

print(result)

# Optimized solution
N = int(eval(input()))
result = 0

for i in range(1, N+1):
    if i%2 == 0:
            continue
            
    count = 0
    for j in range(1, i+1):
        if i % j == 0:
            count += 1
    if count == 8:
        result += 1

print(result)
# Original solution
N = int(eval(input()))
L = []
for i in range(1,N+1) :
    if i % 2 != 0 :
        l = 0
        for j in range(1,201) :
            if i % j == 0 :
                l += 1
        L.append(l)
print((L.count(8)))



# Optimized solution
N = int(eval(input()))
L = []

for j in range(1,201) :
    counter = 0
    if j % 2 != 0 :
        for i in range(1,N+1) :
            if j % i == 0 :
                counter += 1
        if counter == 8 :
            L.append(j)

p = 0
for i in L :
    if i <= N :
        p += 1
    else :
        break
print(p)
# Original solution
N = int(eval(input()))

ans = 0
for n in range(1, N+1, 2):
    count = 0
    for i in range(1, n+1):
        if n % i == 0:
            count += 1
    if count == 8:
        ans += 1

print(ans)

# Optimized solution
N = int(eval(input()))

def div_count(i):
    count = 0
    for div in range(1, i+1):
        if i % div == 0:
            count += 1

    return count

ans = 0
for i in range(1, N+1, 2):
    if div_count(i) == 8:
        ans += 1

print(ans)
# Original solution
import collections

n = int(eval(input()))


def eratosthenes(n):
    sieve = [True for _ in range(n + 1)]
    sieve[0] = False
    sieve[1] = False

    def _update(p):
        if sieve[p]:
            for i in range(p * 2, n + 1, p):
                sieve[i] = False

    _update(2)
    p = 3
    while p * p <= n:
        _update(p)
        p += 2
    return sieve


sieve = eratosthenes(n)

res = 0
for k in range(1, n + 1, 2):
    counter = collections.Counter()
    for i in range(1, k):
        if sieve[i]:
            while k % i == 0:
                counter[i] += 1
                k //= i
    p = 1
    for v in list(counter.values()):
        p *= v + 1
    if p == 8:
        res += 1

print(res)

# Optimized solution
n = int(eval(input()))

res = 0
for k in range(1, n + 1, 2):
    count = 0
    for i in range(1, k + 1):
        if k % i == 0:
            count += 1
    if count == 8:
        res += 1

print(res)
# Original solution
s=[]
for i in range(201)[105::2]:
  d=1;k=i
  for h in range(2,i+1):
    if i%h==0:
      cnt=0
      while i%h==0:
        cnt+=1
        i//=h
      d*=(cnt+1)
  if d==8:
    s.append(k)
ans=0;n=int(eval(input()))
for f in s:
  if n>=f:ans+=1
print(ans)

# Optimized solution
s=[105, 135, 165, 189, 195]
ans=0;n=int(eval(input()))
for f in s:
  if n>=f:ans+=1
print(ans)
# Original solution
n = int(eval(input()))
ans = 0

for i in range(1, n + 1):
    count = 0
    if i % 2 == 0:
        continue
    for j in range(1, i + 1):
        if i % j == 0:
            count += 1
    if count == 8:
        ans += 1

print(ans)


# Optimized solution
n = int(eval(input()))
ans = 0

for i in range(1, n + 1, 2):
    count = 0
    for j in range(1, i + 1):
        if i % j == 0:
            count += 1
    if count == 8:
        ans += 1

print(ans)
# Original solution
def n0():return int(eval(input()))
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(eval(input())) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]

n=n0()

ans=0
for k in range(105,n+1,2):
    c=0
    for i in range(1,int(k**0.5)+1):
        if k%i==0:
            c+=2
    if i**2==k:
        c-=1
    if c==8:
        ans+=1
print(ans)

# Optimized solution
def n0():return int(eval(input()))
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(eval(input())) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]

n=n0()

ans=0
for k in range(105,n+1,2):
    c=0
    for i in range(1,k+1):
        if k%i==0:
            c+=1
#     if i**2==k:
#         c-=1
    if c==8:
        ans+=1
print(ans)
# Original solution
n=int(eval(input()))
ans=0
def yakusu(n):
    cnt=0
    for i in range(1,int(n**0.5)+1):
        if n%i==0:
            cnt+=1
            if i**2!=n:
                cnt+=1
    return cnt
for i in range(1,n+1,2):
    if yakusu(i)==8:
        ans+=1    
print(ans)

# Optimized solution
n=int(eval(input()))
ans=0
def make_divisors(n):
      divisors=[]
      for i in range(1,int(n**0.5)+1):
          if n%i == 0:
              divisors.append(i)
              if i != n//i:
                  divisors.append(n//i)
      return len(divisors)
for i in range(1,n+1,2):
    if make_divisors(i)== 8:
        ans+=1
print(ans)
# Original solution
N = int(eval(input()))
res = 0
for n in range(1, N+1, 2):
    cnt = 0
    for i in range(1, n+1):
        if n % i == 0:
            cnt += 1
    if cnt == 8:
        res += 1
print(res)

# Optimized solution
n = int(eval(input()))

ans = 0

for i in range(1,n+1,2):
    con =0
    for j in range(1,i+1):
        if i % j == 0:
            con += 1
        if con == 8:
            ans += 1

print(ans)
# Original solution
N = int(eval(input())) + 1
nums_count = 0
for i in range(1, N):
    if i % 2 == 0:
        continue
    count = 1
    for j in range(1, int(i / 2)):  # 8なら1,2,4,8で、1~4までやれば良い。最後に自分をたす あれ、もしかしてN/3?
        if i % j == 0:
            count += 1
    if count == 8:
        nums_count += 1

print(nums_count)


# Optimized solution
N = int(eval(input())) + 1
nums_count = 0
for i in range(1, N):
    if i % 2 == 0:
        continue
    count = 1
    for j in range(1, int(i / 3) + 1):  # 8なら1,2,4,8で、1~4までやれば良い。最後に自分をたす あれ、もしかしてN/3?
        if i % j == 0:
            count += 1
    if count == 8:
        nums_count += 1

print(nums_count)
# Original solution
n=int(eval(input()))
ans=0
for i in range(1,n+1):
  count=0
  for j in range(1,i+1):
    if i%j==0:
      count+=1
  if i%2==1 and count==8:
    ans+=1
print(ans)

# Optimized solution
n=int(eval(input()))
def make_divisors(n):
  divisors=[]
  for i in range(1,int(n**0.5)+1):
    if n%i==0:
      divisors.append(i)
      if i!=n//i:
        divisors.append(n//i)

  divisors.sort()
  return divisors
ans=0
for i in range(1,n+1):
  if i%2==1 and len(make_divisors(i))==8:
    ans+=1
print(ans)
# Original solution
n = int(eval(input()))
ans = 0

for i in range(1, n + 1):
    count = 0
    for j in range(1, n + 1):
        if i % 2 == 0:
            break
        if i % j == 0:
            count += 1
    if count == 8:
        ans += 1
        
print(ans)

# Optimized solution
n = int(eval(input()))
ans = 0
for i in range(1, n + 1):
    if i % 2 == 1:
        cnt = 0
        for j in range(1, i + 1):
            if i % j == 0:
                cnt += 1
        if cnt == 8:
            ans += 1
print(ans)
# Original solution
def div(n):
  d=0
  for i in range(1, n+1):
    if n%i==0:
      d+=1
  return d

n=int(eval(input()))
ans=0
for i in range(1, n+1, 2):
  if div(i)==8:
    ans+=1
print(ans)


# Optimized solution
N = int(eval(input()))

ans = 0
for x in range(1, N + 1, 2):
    d = 0
    for y in range(1, int(x ** 0.5 + 0.5) + 1):
        if x % y == 0:
            d += 1
            if y * y != x:
                d += 1
    if d == 8:
        ans += 1

print(ans)
# Original solution
n = int(eval(input()))
ans = 0

for i in range(1, n+1, 2):
    cnt = 0
    for j in range(1, n+1):
        if(i % j == 0):
            cnt += 1
    if(cnt == 8):
        ans += 1

print(ans)

# Optimized solution
N = int(eval(input()))

def sum_up(num):
    cnt_n = 0
    for i in range(105, num+1, 2):
        tmp = 0
        for j in range(1, i+1):
            if(i%j == 0):
                tmp += 1
                if(tmp > 8):
                    break
        if(tmp == 8):
            cnt_n += 1
    return cnt_n
    
if(N < 105):
    print((0))
else:
    ans = sum_up(N)
    print(ans)
# Original solution
while 1:
	try:
		h=[eval(input()) for i in [1]*5]
		l=set(h)
		if 1 in l and 2 in l:w=1
		elif 1 in l and 3 in l:w=3
		else:w=2
		if len(l)!=2:
			for i in h:print(3)
		else:
			for i in h:print(1 if i==w else 2)
	except:break

# Optimized solution
while 1:
	try:
		h=[eval(input()) for i in [1]*5]
		if 1 in h and 2 in h:w=1
		elif 1 in h:w=3
		else:w=2
		if len(set(	h))!=2:
			for i in h:print(3)
		else:
			for i in h:print(1 if i==w else 2)
	except:break
# Original solution
n,t=list(map(int,input().split()))
mncst=1001
for i in range(n):
    a,b=list(map(int,input().split()))
    if b<=t:
        if a<mncst:
            mncst=a
if mncst==1001:
    mncst='TLE'

print(mncst)

# Optimized solution
firstLine = list(map(int, input().split()))
costs = []

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

if len(costs)>0:
    print((sorted(costs)[0]))
else:
    print("TLE")
# Original solution
# ABC112B - Time Limit Exceeded
n, t = list(map(int, input().rstrip().split()))
data = [list(map(int, input().rstrip().split())) for _ in range(n)]
match = []

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

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

# Optimized solution
# ABC112B - Time Limit Exceeded
import sys
input = sys.stdin.readline

def main():
    n, t = tuple(map(int, input().rstrip().split()))
    data = tuple(tuple(map(int, input().rstrip().split())) for _ in range(n))
    match = {i[0] for i in data if i[1] <= t}
    if match == set():
        print("TLE")
    else:
        print((min(match)))


if __name__ == "__main__":
    main()
# Original solution
def a():
    n=list(map(int, input().split()))
    c=list()
    t = list()
    for i in range(n[0]):
        s = list(map(int, input().split()))
        c.append(s[0])
        t.append(s[1])
    z=list()
    z[len(z):]=t[:len(t)]
    z.sort()
    if z[0]>n[1]:
        print("TLE")
        return 0
    l=0
    for i in range(1,len(c)):
        if (c[i]<=c[l]) & (t[i]<=n[1]):
            l = i
    print((c[l]))
    return 0
a()

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



print((MRX()))
# Original solution

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

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

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

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


# Optimized solution

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

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

if C == 1001:
    print("TLE")
else:
    print(C)
# Original solution
N,Time = list(map(int,input().split()))
C = []
T = []
for i in range(N):
    c,t = list(map(int,input().split()))
    if t <= Time:
        C.append(c)
        T.append(t)
if len(C) == 0:
    print("TLE")
else:
    print((min(C)))


# Optimized solution
N,T = list(map(int,input().split()))
ans = 1e9
for i in range(N):
    c,t = list(map(int,input().split()))
    if t <= T:
        ans = min(ans,c)
if ans == 1e9:
    print("TLE")
else:
    print(ans)
# Original solution
N,T = list(map(int,input().split()))
root = []
ans = 10**4
for i in range(N):
    c,t = list(map(int,input().split()))
    root.append([c,t])
for i in range(N):
    if root[i][1] > T:
        continue
    else:
        ans = min(ans,root[i][0])
if ans == 10**4:
    print("TLE")
else:
    print(ans)

# Optimized solution
N, T = list(map(int, input().split()))
ans = 10 ** 4
root = [list(map(int, input().split())) for _ in range(N)]

for i in range(N):
    if root[i][1] > T:
        continue
    else:
        ans = min(ans, root[i][0])

print(("TLE" if ans == 10 ** 4 else ans))
# Original solution
N,T = (int(i) for i in input().split())

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

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

# Optimized solution
N,T = (int(i) for i in input().split())

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

if cost == 10000:
    print("TLE")
else:
    print(cost)
# Original solution
N, T = list(map(int, input().split()))
ans = 1001
for i in range(N):
    tmp = list(map(int, input().split()))
    if tmp[1] <= T:
        ans = min(ans, tmp[0])

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


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

if ans == 1001:
    print('TLE')
else:
    print(ans)
# Original solution
n,t=list(map(int,input().split()));c=[]
for i in range(n):
  a,b=list(map(int,input().split()))
  if b<=t:
    c.append(a)
if c==[]:print("TLE")
else:c.sort();print((c[0]))

# Optimized solution
n,t=list(map(int,input().split()))
ans=10**9
for i in range(n):
  c,tt=list(map(int,input().split()))
  if tt<=t:ans=min(ans,c)
if ans==10**9:print("TLE")
else:print(ans)
# Original solution
route_num, limit = list(map(int, input().split(' ')))

costs = []
spends = []
for i in range(route_num):
    cost, spend = list(map(int, input().split(' ')))
    costs.append(cost)
    spends.append(spend)

min_cost = 2000
for cost, spend in zip(costs, spends):
    if spend <= limit and cost < min_cost:
        min_cost = cost

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


# Optimized solution
route_num, limit = list(map(int, input().split(' ')))

costs = []
spends = []
for i in range(route_num):
    cost, spend = list(map(int, input().split(' ')))
    costs.append(cost)
    spends.append(spend)

max_cost = 2000
for cost, spend in zip(costs, spends):
    if spend <= limit and cost < max_cost:
        max_cost = cost

if max_cost == 2000:
    print("TLE")
else:
    print(max_cost)
# Original solution
n,T = list(map(int,input().split()))
ct = []
mn = 1001
for i in range(n):
    c,t = list(map(int,input().split()))
    if T >= t:
        if mn > c:
            mn = c
print(("TLE" if mn==1001 else mn))

# Optimized solution
n,T = list(map(int,input().split()))
mn = 10**6
for i in range(n):
    c,t = list(map(int,input().split()))
    if T >= t:
        if mn > c:
            mn = c
print(('TLE' if mn==10**6 else mn))
# Original solution
n,t = list(map(int,input().split()))
ct = [list(map(int,input().split())) for i in range(n)]
T = []

for h in range(n):
  T.append(ct[h][1])
  
if min(T) > t:
  print("TLE")
  exit()
else:
  for j in range(n):
    if ct[j][1] <= t:
      c = ct[j][0]
      k = j
      break
 

for i in range(k+1,n):
  if ct[i][1] <= t:
    c = min(c,ct[i][0])
    
print(c)

# Optimized solution
n,T = list(map(int,input().split()))
tmp = 114514

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

if tmp == (114514):
  print("TLE")
else:
  print(tmp)
# Original solution
N, T = list(map(int, input().split()))
path_list = [list(map(int, input().split())) for _ in range(N)]
min_cost = 1001
for path in path_list:
	if T >= path[1] and path[0] < min_cost:
		min_cost = path[0]
print((min_cost if min_cost < 1001 else 'TLE'))

# Optimized solution
n, t = list(map(int, input().split()))
ct = list([x for x in [list(map(int, input().split())) for i in range(n)] if x[1] <= t])
print(("TLE" if len(ct) == 0 else min(ct)[0]))
# Original solution
a, b = list(map(int,input().split()))
list1=[]
list2=[]
for i in range (a):
     x,y=list(map (int,input().split()))
     list1.append(x)
     list2.append(y)
mini= 0x3f3f3f3f
for i in range (a) :
    if list1[i] < mini and list2[i] <= b :
        mini=list1[i]

if (mini!= 0x3f3f3f3f):
    print(mini)
else :
    print ("TLE")



# Optimized solution
N,T= [int(x) for x in input().split()]
c=0
t=0
z=0
x=0
mini=0
lcost=[]
ltime=[]
cost=[]
time=[]
for i in range(N):
    c,t=[int(x) for x in input().split()]
    cost.append(c)
    time.append(t)
for i in time:
    z+=1
    if i <= T:
        ltime.append(i)
        lcost.append(cost[z-1])

if ltime==[] and lcost==[]:
    print("TLE")
else:
    
    for i in lcost:
        if x==0:
           mini=i
           x+=1
        if i < mini:
           mini=i
    print(mini)
# Original solution
n, t = list(map(int,input().split()))
ts = []
for i in range(n):
    c = list(map(int,input().split()))
    if c[1] <= t:
        ts.append(c[0])
if ts == []:
    print('TLE')
else:
    print((min(ts)))

# Optimized solution
n, t = list(map(int, input().split()))
stack =  []
for i in range(n):
    c, ts = list(map(int, input().split()))
    if ts <= t:
        stack.append(c)
print((min(stack) if stack != [] else 'TLE'))
# Original solution
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))


# Optimized solution
n, T = list(map(int, input().split()))

ans = float("inf")
for _ in range(n):
    c, t = list(map(int, input().split()))
    if t <= T:
        ans = min(ans, c)

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

print(ans)
# Original solution
N, T = list(map(int, input().split()))
ans = float("inf")

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

# Optimized solution
N, T = list(map(int, input().split()))
ans = 1005

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

if ans < 1005:
    print(ans)
else:
    print("TLE")
# Original solution
n,t = list(map(int,input().split()))
c = []
for i in range(n):
    c1,t1 = list(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]))

# Optimized solution
n,t = list(map(int,input().split()))
c = []
for _ in range(n):
    c1,t1 = list(map(int,input().split()))
    if t1 <= t:
        c.append(c1)
if len(c) == 0:
    print("TLE")
else:
    c.sort(key=int)
    print((c[0]))
# Original solution
N, T = list(map(int, input().split()))
CT = [tuple(map(int, input().split())) for _ in range(N)]

minimum = min(CT, key=lambda ct:[ct[0], 1001][not(ct[1] <= T)])
print(([minimum[0], "TLE"][not(minimum[1] <= T)]))


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

*CTf, = [ct for ct in CT if ct[1] <= T]
if not CTf:
	print("TLE")
	exit()

minimum = min(CTf, key=lambda ct:ct[0])
print((minimum[0]))
# Original solution
N, T = list(map(int, input().split()))
L = [list(map(int, input().split())) for k in range(N)]
ans = 10000
for l in L:
    if l[1] <= T:
        ans = min(ans,l[0])
print((ans if ans != 10000 else "TLE"))

# Optimized solution
N, T = list(map(int,input().split()))
ans = float("inf")
for k in range(N):
    c, t = list(map(int,input().split()))
    if t <= T:
        ans = min(ans, c)
print((ans if ans <= 1000 else "TLE"))
# Original solution
N,T=list(map(int,input().split()))
C=[list(map(int, input().split())) for _ in range(N)]
e=[]
for i in C:
  if T>=i[1]:
    e.extend([i[0]])
print(('TLE' if len(e)==0 else min(e)))

# Optimized solution
N,T=list(map(int,input().split()))
C=[list(map(int, input().split())) for _ in range(N)]
e=10000
for i in C:
  if T>=i[1] and e>i[0]:
    e=i[0]
print(('TLE' if e==10000 else e))