qyliang/CodeNanoFix huggingface dataset:
Buggy code:
ans1 = 1000
ans2 = 1000
ans_f = 0
a,b = map(int,input().split())
for i in range(a):
    c,d = map(int,input().split())
    if d <= b:
        ans_f = 1
        if d < ans2:
            ans1 = c
            ans2 = d
if ans_f == 1:
    print(ans1)
else:
    print('TLE')

Fixed code:
ans = 1000
ans_f = 0
a,b = map(int,input().split())
for i in range(a):
    c,d = map(int,input().split())
    if d <= b:
        ans_f = 1
        if c < ans:
            ans = c
if ans_f == 1:
    print(ans)
else:
    print('TLE')
Buggy code:
n ,t = [int(x) for x in input().split()]
arr = [list(map(int, input().split())) for _ in range(n)]

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

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

ans = 9999
for i in range(n):
    if arr[i][1] <= t:
        if arr[i][0] <= ans:
            ans = arr[i][0]
if ans == 9999:
    print("TLE")
else:
    print(ans)
Buggy code:
n,t = map(int, input().split())
minc = 10**8
for i in range(n):
    c, ti = map(int, input().split())
    if ti >= t: continue
    if c < minc: minc = c
print(minc if minc <= 10**3 else "TLE")

Fixed code:
n,t = map(int, input().split())
minc = 10**8
for i in range(n):
    c, ti = map(int, input().split())
    if ti > t: continue
    if c < minc: minc = c
print(minc if minc <= 10**3 else "TLE")
Buggy code:
N, T = map(int, input().split())
C = []
for _ in range(N):
    c, t = map(int, input().split())
    if t < T:
        C.append(c)
if len(C) == 0:
    print('TLE')
else:
    print(min(C))

Fixed code:
N, T = map(int, input().split())
C = []
for _ in range(N):
    c, t = map(int, input().split())
    if t <= T:
        C.append(c)
if len(C) == 0:
    print('TLE')
else:
    print(min(C))
Buggy code:
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 = False
for ct in CT:
  if ct[1] <= T:
    print(ct[0])
    ans = True
    break
if ans:
  print("TLE") 


Fixed code:
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")
Buggy code:
N, T = map(int, input().split())
ct = [list(map(int, input().split())) for _ in range(N)]
ct.sort(key=lambda x:(x[1], x[0]))
if ct[0][1] <= T:
  print(ct[0][0])
else:
  print('TLE')

Fixed code:
N, T = map(int, input().split())
ct = [list(map(int, input().split())) for _ in range(N)]
costs = list(filter(lambda x: x[1] <= T, ct))
if len(costs) == 0:
  print('TLE')
else:
  costs.sort(key=lambda x: x[0])
  print(costs[0][0])
Buggy code:
n,w = map(int,input().split())
m = 1001
for i in range(n):
    a,b = map(int,input().split())
    if b <= w and a < m:
        m = a
if m == 101:
    print("TLE")
else:
    print(m)
    

Fixed code:
n,w = map(int,input().split())
m = 1001
for i in range(n):
    a,b = map(int,input().split())
    if b <= w and a < m:
        m = a
if m == 1001:
    print("TLE")
else:
    print(m)
Buggy code:
n, t = [int(_) for _ in input().split()]
e = [[int(_) for _ in input().split()] for _ in range(n)]

c = 1001
for i in range(n):
    if e[i][1] < t:
        c = min(c, e[i][0])
if c <= 1000:
    print(str(c))
else:
    print('TLE')

Fixed code:
n, t = [int(_) for _ in input().split()]
e = [[int(_) for _ in input().split()] for _ in range(n)]

c = 1001
for i in range(n):
    if e[i][1] <= t:
        c = min(c, e[i][0])
if c <= 1000:
    print(str(c))
else:
    print('TLE')
Buggy code:
Base = input().split(" ")
N = int(Base[0])
TL = int(Base[1])
TX = 10000

for i in range(N):
    Roi = input().split(" ")
    Coi = int(Roi[0])
    TLi = int(Roi[1])
    if TL >= TLi:
        if TX >= int(Coi):
            TX = Coi
print(TX)

Fixed code:
Base = input().split(" ")
N = int(Base[0])
TL = int(Base[1])
TX = 10000

for i in range(N):
    Roi = input().split(" ")
    Coi = int(Roi[0])
    TLi = int(Roi[1])
    if TL >= TLi:
        if TX >= int(Coi) or i ==0:
            TX = Coi
if TX == 10000:
    print("TLE")
else:
    print(TX)
Buggy code:
n, t = map(int, input().split())
A = []
for i in range(n):
  a = list(map(int, input().split()))
  if a[1] =< t:
    A.append(a[0])
if len(A) == 0:
  print('TLE')
else:
  print(min(A))

Fixed code:
n, t = map(int, input().split())
A = []
for i in range(n):
  a = list(map(int, input().split()))
  if a[1] <= t:
    A.append(a[0])
if len(A) == 0:
  print('TLE')
else:
  print(min(A))
Buggy code:
N, T = map(int, input().split())
c = []
t = []
for i in range(N):
    a, b = map(int, input().split())
    c.append(a)
    t.append(b)      
print(N, T)
print(c, t)

ans = []

for i, v in enumerate(t):
    if v <= T:
        ans.append(c[i])

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

Fixed code:
N, T = map(int, input().split())
c = []
t = []

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

ans = []
for i, v in enumerate(t):
    if v <= T:
        ans.append(c[i])

if len(ans) > 0:
    print(min(ans))
else:
    print('TLE')
Buggy code:
N,T=map(int, input().split())
R=[999999999]
for i in range(N):
  c,t=map(int, input().split())
  if T>t:
    R.append(c)
    
print('TLE' if len(R)==1 else min(R))

Fixed code:
N,T=map(int, input().split())
R=[999999999]
for i in range(N):
  c,t=map(int, input().split())
  if T>=t:
    R.append(c)
    
print('TLE' if len(R)==1 else min(R))
Buggy code:
N, T = map(int,input().split())

C,t = [], []

for i in range(N):
    CT = list(map(int,input().split()))
    C.append(CT[0])
    t.append(CT[1])

C_min = 10000
for i,t_i in enumerate(t):
    print(t_i, C[i], C_min)
    if t_i <= T and C_min > C[i]:
        C_min = C[i]
        
if C_min == 0:
    print('TLE')
else:
    print(C_min)

Fixed code:
N, T = map(int,input().split())

C,t = [], []

for i in range(N):
    CT = list(map(int,input().split()))
    C.append(CT[0])
    t.append(CT[1])

C_min = 10000
for i,t_i in enumerate(t):
    if t_i <= T and C_min >= C[i]:
        C_min = C[i]
        
if C_min == 10000:
    print('TLE')
else:
    print(C_min)
Buggy code:
N, T = map(int, input().split())
ans = 1001
for i in range(n):
    c, t = map(int, input().split())
    if t > T:
        continue
    if ans > c:
        ans = c

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


Fixed code:
N, T = map(int, input().split())
ans = 1001
for i in range(N):
    c, t = map(int, input().split())
    if t > T:
        continue
    if ans > c:
        ans = c

if ans == 1001:
    print('TLE')
else:
    print(ans)
Buggy code:
N, T = [int(elem) for elem in input().split()]
min_cost = None
min_cost_time = None
for i in range(0, N):
  c, t = [int(elem) for elem in input().split()]
  if t < T:
    if min_cost is None:
      min_cost = c
      min_cost_time = t
    else:
      if c < min_cost:
        min_cost = c
        min_cost_time = t
if min_cost is None:
  print('TLE')
else:
  print(min_cost)

Fixed code:
N, T = [int(elem) for elem in input().split()]
min_cost = None
min_cost_time = None
for i in range(0, N):
  c, t = [int(elem) for elem in input().split()]
  if t <= T:
    if min_cost is None:
      min_cost = c
      min_cost_time = t
    else:
      if c < min_cost:
        min_cost = c
        min_cost_time = t
if min_cost is None:
  print('TLE')
else:
  print(min_cost)
Buggy code:
n, t = input().split()
ret = 1001
for i in range(n):
  a, b = input().split()
  if b <= t:
    ret = min(a, ret)
    
if ret == 1001:
  print('TLE')
else:
  print(ret)

Fixed code:
n, t = map(int, input().split())
ret = 1001
for i in range(n):
  a, b = map(int, input().split())
  if b <= t:
    ret = min(a, ret)
    
if ret == 1001:
  print('TLE')
else:
  print(ret)
Buggy code:
N,T = map(int,input().split())
min_cost = 10**3 + 1
for i in range(n):
    c, t = map(int,input().split())
    if t <= T and c < min_cost:
        min_cost = c
if c != 10**3 + 1:
    print(min_cost)
else:
    print("TLE")

Fixed code:
N,T = map(int,input().split())
min_cost = 10**3 + 1
for i in range(N):
    c, t = map(int,input().split())
    if t <= T and c < min_cost:
        min_cost = c
if min_cost != 10**3 + 1:
    print(min_cost)
else:
    print("TLE")
Buggy code:
N,T = map(int,input().split())
cost = 10000
ans = False
for i in range(N):
    c,t = map(int,input().split())
    if(T>t and c < cost):
        cost = min(cost,c)
        ans = True
if(ans):
    print(cost)
else:
    print("TLE")

Fixed code:
N, T = map(int, input().split())
ans = 10000
is_back = False
for i in range(N):
  c, t = map(int, input().split())
  if t <= T and ans > c:
    ans = c
    is_back = True
if is_back == False:
  print("TLE")
else:
  print(ans)
Buggy code:
def main04():
    buf = input("");
    bufs = buf.split(" ");
    val1 = [];
    for i in range(len(bufs)):
        val1.append(int(bufs[i]));
    val2 = [];
    for i in range(val1[0]):
        buf = input("");
        bufs = buf.split(" ");
        kari = [];
        kari.append(int(bufs[0]));
        kari.append(int(bufs[1]));
        val2.append(kari);
    min1 = 10000;
    for i in range(val1[0]):
        if val2[1][i] < val1[1] and val2[0][i] < min1:
            min1 = val2[0][i];
    if min1 == 10000:
        print("TLE");
    else:
        print(min1);

if __name__ == '__main__':
    main03()

Fixed code:
def main04():
    buf = input("");
    bufs = buf.split(" ");
    val1 = [];
    for i in range(len(bufs)):
        val1.append(int(bufs[i]));
    val2 = [];
    for i in range(val1[0]):
        buf = input("");
        bufs = buf.split(" ");
        kari = [];
        kari.append(int(bufs[0]));
        kari.append(int(bufs[1]));
        val2.append(kari);
    min1 = 10000;
    for i in range(val1[0]):
        if val2[i][1] < val1[1] + 1 and val2[i][0] < min1:
            min1 = val2[i][0];
    if min1 == 10000:
        print("TLE");
    else:
        print(min1);

if __name__ == '__main__':
    main04()
Buggy code:
n,t = map(int,input().split())

ct = [[int(i) for i in input().split()] for _ in range(n)]

x=[]
for i in range(n):
  if ct[i][1] <= t:
    x.append(ct[i][0])
    
    
x.sort()

print(x[0])

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

Fixed code:
n,t = map(int,input().split())

ct = [[int(i) for i in input().split()] for _ in range(n)]

x=[]
for i in range(n):
  if ct[i][1] <= t:
    x.append(ct[i][0])
    
    
x.sort()

if len(x) != 0:
  print(x[0])
else:
  print("TLE")
Buggy code:
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

Fixed code:
N, T = map(int, input().split())
m = 1001

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

print("TLE" if m == 1001 else m)
Buggy code:
A, B = map(int,input().split())
cost = list()
m = B + 1
for i in range(A):
  x, y = map(int, input().split())
  if y < min:
    m = y
    cost.append(x)
print(min(cost) if m <= B else 'TLE')

Fixed code:
A, B = map(int,input().split())
cost = list()
m = B + 1
for i in range(A):
  x, y = map(int, input().split())
  if y < m:
    cost.append(x)
print(min(cost) if len(cost) != 0 else 'TLE')
Buggy code:
N, T = map(int, input().split())

mc = float("inf")
ans = "TLE"

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

print(ans)

Fixed code:
N, T = map(int, input().split())

mc = float("inf")
ans = "TLE"

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

print(ans)
Buggy code:
n, T =  map(int, input().split())

cost = 100000

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

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

Fixed code:
n, T =  map(int, input().split())

cost = 100000

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

if cost == 100000:
    print('TLE')
else:
    print(cost)
Buggy code:
N,T = input().split(" ")
N,T = int(N),int(T)

time = dict()
for i in range(N):
	c,t = input().split(" ")
	time[int(c)] = int(t)
cost = 10000
print(sorted(time.items(), key=lambda item: item[1]))
for key, value in sorted(time.items(), key=lambda item: item[1]):
	if value <= T:
		if cost > key:
			cost = key
			# print(cost)

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

Fixed code:
N,T = input().split(" ")
N,T = int(N),int(T)

time = dict()
for i in range(N):
	c,t = input().split(" ")
	time[int(c)] = int(t)
cost = 10000
# print(sorted(time.items(), key=lambda item: item[1]))
for key, value in sorted(time.items(), key=lambda item: item[1]):
	if value <= T:
		if cost > key:
			cost = key
			# print(cost)

if cost ==10000:
	print("TLE")
else:
	print(cost)
Buggy code:
n,t=map(int,input().split())
clis=[]
tlis=[]
for i in range(n):
  a,b=map(int,input().split())
  clis.append(a)
  tlis.append(b)
lis2=[]
for i in range(n):
  if tlis[i] > t:
    pass
  else:
    lis2.append(clis[i])
if len(lis2)==0:
  print(TLE)
else:
  print(min(lis2))

Fixed code:
n,t=map(int,input().split())
clis=[]
tlis=[]
for i in range(n):
  a,b=map(int,input().split())
  clis.append(a)
  tlis.append(b)
lis2=[]
for i in range(n):
  if tlis[i] > t:
    pass
  else:
    lis2.append(clis[i])
if len(lis2)==0:
  print("TLE")
else:
  print(min(lis2))
Buggy code:
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(max(ans))
else:
  print("TLE")

Fixed code:
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(min(ans))
else:
  print("TLE")
Buggy code:
N,T = list(map(int, input().split()))
max = 10000
for i in range(N):
    c,t = list(map(int, input().split()))
    if t <= T and c < max:
        max = c
if max == 1000:
    print("TLE")
else:
    print(max)

Fixed code:
N,T = list(map(int, input().split()))
max = 10000
for i in range(N):
    c,t = list(map(int, input().split()))
    if t <= T and c <= max:
        max = c
if max == 10000:
    print("TLE")
else:
    print(max)
Buggy code:
n,t = map(int,input().split())
data=[]

for i in range(n):
    data.append(list(map(int,input().split())))
    
data.sort(key=lambda x:x[1])

pos = 0
for i in range(len(data)):
    if data[i][1] >t:
        pos = i-1
        
if pos==-1:
    print('TLE')
else:
    new = data[:pos]
    new.sort(key=lambda x:x[0])
    print(new[0][0])

Fixed code:
n,t = map(int,input().split())
data=[]

for i in range(n):
    data.append(list(map(int,input().split())))
    
data.sort(key=lambda x:x[1])

pos = len(data)
for i in range(len(data)):
    if data[i][1] >t:
        pos = i
        break
        
if pos==0:
    print('TLE')
else:
    new = data[:pos]
    new.sort(key=lambda x:x[0])
    print(new[0][0])
Buggy code:
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)


Fixed code:
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)
Buggy code:
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())

cost= 10000
for i in range(n):
    if t[i] <= T and c[i] <= cost:
        cost = c[i]
        print(i)
if cost == 10000:
    print("TLE")
else:
    print(cost)

Fixed code:
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())

cost= 10000
for i in range(n):
    if t[i] <= T and c[i] <= cost:
        cost = c[i]
        
if cost == 10000:
    print("TLE")
else:
    print(cost)
Buggy code:
n,T=map(int,input().split())
cost=1001
for i in range(n):
    c,t=map(int,input().split())
    if T>t:cost=min(cost,c)
print(cost if cost<1001 else "TLE")

Fixed code:
n,T=map(int,input().split())
cost=1001
for i in range(n):
    c,t=map(int,input().split())
    if T>=t:cost=min(cost,c)
print(cost if cost<1001 else "TLE")
Buggy code:
n,T = map(int,input().split())
ct = []
mn = 1001
for i in range(n):
    c,t = map(int,input().split())
    if T >= t:
        if mn > c:
            mn = c
print("TLE" if mn==10**9 else mn)

Fixed code:
n,T = map(int,input().split())
ct = []
mn = 1001
for i in range(n):
    c,t = map(int,input().split())
    if T >= t:
        if mn > c:
            mn = c
print("TLE" if mn==1001 else mn)
Buggy code:
n, T = map(int,input().split())
A=[]
for i in range(n):
  a = list(map(int,input().split()))
  if a[1]<=T:
    A.append(a[0])

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

Fixed code:
n,t=map(int, input().split())
A=[]
for i in range(n):
  a=list(map(int, input().split()))
  if a[1] <= t:
    A.append(a[0])
if len(A)==0:
  print('TLE')
else:
  print(min(A))
Buggy code:
N,T=map(int,input().split())
ct = [[0,0] for i in range N]
for i in range(N):
  ct[i]=list(map(int,input().split()))
ct.append([-1,T])
ct.sort(reverse=True,key=lambda x:x[1])
index = ct.index([-1,T])
if index==0:
  print("TLE")
else:
  ans = sorted(ct[:index],key=lambda x:x[0])
  print(ans[0][0])

Fixed code:
N,T=map(int,input().split())
ct = [[0,0] for i in range(N)]
for i in range(N):
  ct[i]=list(map(int,input().split()))
ct.append([-1,T])
ct.sort(key=lambda x:x[1])
index = ct.index([-1,T])
if index==0:
  print("TLE")
else:
  ans = sorted(ct[:index],key=lambda x:x[0])
  print(ans[0][0])
Buggy code:
n,t = map(int,input().split())

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

if ans == 1234567:
    print("LTE")
else:
    print(ans)
        

Fixed code:
n,t = map(int,input().split())

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

if ans == 1234567:
    print("TLE")
else:
    print(ans)
Buggy code:
N,T=map(int, input().split())
ans=9999
for i in range(N):
  A,B=map(int, input().split())
  if (T>B):
    if(ans>A):
      ans=A
if(ans==9999):
  print("TLE")
else:
  print(ans)

Fixed code:
N,T=map(int, input().split())
ans=9999
for i in range(N):
  A,B=map(int, input().split())
  if (T>=B):
    if(ans>=A):
      ans=A
if(ans==9999):
  print("TLE")
else:
  print(ans)
Buggy code:
N, T = map(int, input().split())
ans=1001
for _ in range(N):
    c, t = map(int, input().split())
    if T>t:
        ans=min(ans,c)

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

print(ans)

Fixed code:
N, T = map(int, input().split())
ans=1001
for _ in range(N):
    c, t = map(int, input().split())
    if T>=t:
        ans=min(ans,c)

if ans==1001:
    print('TLE')
else:
    print(ans)
Buggy code:
n,t=map(int,input().spplit())
ct=[list(map(int,input().split())) for i in range(n)]
ans=1001
for i in range(n):
  if ct[n][1]<=t and ct[n][0]<=ans:
    ans=ct[n][0]
if ans<1001:
  print(ans)
else:
  print("TLE")

Fixed code:
n,t=map(int,input().split())
ct=[list(map(int,input().split())) for i in range(n)]
ans=1001
for i in range(n):
  if ct[i][0]<=ans and ct[i][1]<=t:
    ans=ct[i][0]
if ans<1001:
  print(ans)
else:
  print("TLE")
Buggy code:
N, T = map(int, input().split())
CT = [list(map(int, input().split())) for i in range(N)]

ans_c = 10 ** 9
for CTi in CT:
    c, t = CTi
    if t <= T:
        ans_c = c if c < ans_c else ans_c

if ans_c == 10 ** 9:
    print('TEL')
else:
    print(ans_c)


Fixed code:
N, T = map(int, input().split())
CT = [list(map(int, input().split())) for i in range(N)]

ans_c = 10 ** 9
for CTi in CT:
    c, t = CTi
    if t <= T:
        ans_c = c if c < ans_c else ans_c

if ans_c == 10 ** 9:
    print('TLE')
else:
    print(ans_c)
Buggy code:
from sys import stdin
N, T = [int(x) for x in stdin.readline().rstrip().split()]
d = N+1
for i in range(N):
  l = list(map(int, input().split()))
  if l[1] <= T:
    if l[0] < d:
      d = l[0]
if d < N+1:
  print(d)
else:
  print('TLE')

Fixed code:
from sys import stdin
N, T = [int(x) for x in stdin.readline().rstrip().split()]
d = 1001
for i in range(N):
  l = list(map(int, input().split()))
  if l[1] <= T:
    if l[0] < d:
      d = l[0]
if d < 1001:
  print(d)
else:
  print('TLE')
Buggy code:
N, T = map(int, input().split())
minc = 1001
for _ in range(N):
  c, t = map(int, input().split())
  if t < T and c < minc:
    minc = c

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

Fixed code:
N, T = map(int, input().split())
minc = 1001
for _ in range(N):
  c, t = map(int, input().split())
  if t <= T and c < minc:
    minc = c

if minc == 1001:
  print("TLE")
else:
  print(minc)
Buggy code:
N, T = map(int, input().split())
cost = 1001
for i in range(N):
    ci, ti = map(int, input().split())
    if ti <= T and  cost > ti:
        cost = ti
if cost > 1000:
    print('TLE')
    exit()
print(cost)


Fixed code:
N, T = map(int, input().split())
cost = 1001
for i in range(N):
    ci, ti = map(int, input().split())
    if ti <= T and cost > ci:
        cost = ci
if cost > 1000:
    print('TLE')
    exit()
print(cost)
Buggy code:
n,t=input().split()
n=int(n)
t=int(t)
res=10000
for i in range(n):
  s=input().split()
  if int(s[1])<=T:
    res=min(res,int(s[0]))
if res==10000:
  print("TLE")
else:
  print(res)

Fixed code:
n,t=input().split()
n=int(n)
t=int(t)
res=10000
for i in range(n):
  s=input().split()
  if int(s[1])<=t:
    res=min(res,int(s[0]))
if res==10000:
  print("TLE")
else:
  print(res)
Buggy code:
N,T=map(int,input().split())
List=[list(input().split()) for i in range(N)]
List2=[]
List3=[]
for i in List:
        List2.append([int(s) for s in i])
for i in List2:
        if i[1] <= T:
                List3.append(i[0])
print(min(List3))

Fixed code:
N,T=map(int,input().split())
List=[list(input().split()) for i in range(N)]
List2=[]
List3=[]
for i in List:
        List2.append([int(s) for s in i])
for i in List2:
        if i[1] <= T:
                List3.append(i[0])
if List3 == []:
        print("TLE")
else:
        print(min(List3))
Buggy code:
n,T = map(int,input().split())
m = 1001
for _ in range(n):
  c,t = map(int,input().split())
  if t <= T:
    if c < m:
      m = c
if c == 1001:
  print("TLE")
else:
  print(m)
    

Fixed code:
n,T = map(int,input().split())
m = 1001
for _ in range(n):
  c,t = map(int,input().split())
  if t <= T:
    if c < m:
      m = c
if m == 1001:
  print("TLE")
else:
  print(m)