qyliang/CodeNanoFix huggingface dataset:
Buggy code:
n, T = map(int, input().split())
out = 1001
for i in range(n):
  c, t = map(int, input().split())
  if t <= T:
    out = min(out, c)
    
if out == 1001:
  print("LTE")
else:
  print(out)

Fixed code:
n, T = map(int, input().split())
out = 1001
for i in range(n):
  c, t = map(int, input().split())
  if t <= T:
    out = min(out, c)
    
if out == 1001:
  print("TLE")
else:
  print(out)
Buggy code:
N, T = list(map(int, input().split()))
ans = 1001
for i in range(N):
    c, t = list(map(int, input().split()))
    if T < t:
        break
    elif ans < c:
        break
    else:
        ans = c
print(ans if ans < 1001 else 'TLE')

Fixed code:
N, T = list(map(int, input().split()))
ans = 1001
for i in range(N):
    c, t = list(map(int, input().split()))
    if T < t:
        continue
    elif ans < c:
        continue
    else:
        ans = c
print(ans if ans < 1001 else 'TLE')
Buggy code:
N, T = [int(i) for i in input().split()]
data_ls = list()
for i in range(N):
  data_ls.append([int(i) for i in input().split()])
data_ls = [i for i in data_ls if i[1] < T]
if len(data_ls) == 0:
  print("TLE")
else:
  data_ls = sorted(data_ls, key=lambda x:x[0])
  print(data_ls[0][0])

Fixed code:
N, T = [int(i) for i in input().split()]
data_ls = list()
for i in range(N):
  data_ls.append([int(i) for i in input().split()])
data_ls = [i for i in data_ls if i[1] <= T]
if len(data_ls) == 0:
  print("TLE")
else:
  data_ls = sorted(data_ls, key=lambda x:x[0])
  print(data_ls[0][0])
Buggy code:
N, T = map(int, input().split())
c = []
t = []

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

cost = 1000
check = -1

for i in range(N):
    if t[i] <=T and c[i] <= cost:
        check = i
        cost = c[i]
        #print(i)
        #print(cost)

if index == -1:
    print('TLE')
else:
    print(cost)

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

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

cost = 1000
check = -1
for i in range(N):
    if t[i] <=T and c[i] <= cost:
        check = i
        cost = c[i]
        #print(i)
        #print(cost)

if check == -1:
    print('TLE')
else:
    print(cost)
Buggy code:
N,T=list(map(int,input().split()))
c=[]
t=[]
for i in range(N):
    a,b=list(map(int,input().split()))
    c.append(a)
    t.append(b)
tmp=1001
for i in range(N):
    if(t[i]<=T):
        if(tmp>c[i]):
            tmp=c[i]
if(tmp==1001):    print("TLE")
else:    print(c[i])

Fixed code:
N,T=list(map(int,input().split()))
c=[]
t=[]
for i in range(N):
    a,b=list(map(int,input().split()))
    c.append(a)
    t.append(b)
tmp=1001
for i in range(N):
    if(t[i]<=T):
        if(tmp>c[i]):
            tmp=c[i]
if(tmp==1001):    print("TLE")
else:    print(tmp)
Buggy code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

n, t = rm()
min_ = inf
for _ in range(n):
  a, b = rm()
  if b <= t:
    min_ = min(min_, a)
print(min_)











Fixed code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

n, t = rm()
min_ = inf
flag = False
for _ in range(n):
  a, b = rm()
  if b <= t:
    min_ = min(min_, a)
    flag = True
if flag:
  print(min_)
else:
  print('TLE')
Buggy code:
N,T = map(int,input().split())
list_aaa = [list(map(int,input().split())) for i in range(N)]

min_aaa =1001

for i in range(N):
    if T>= list_aaa[i][1]:
        min_aaa = min(min_aaa,list_aaa[i][1])

if min_aaa ==1001:
    print(TLE)
else:
    print(min_aaa)




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

min_aaa =1001

for i in range(N):
    if T>= list_aaa[i][1]:
        min_aaa = min(min_aaa,list_aaa[i][0])

if min_aaa ==1001:
    print("TLE")
else:
    print(min_aaa)
Buggy code:
n,t=map(int,input().split())

for i in range(n):
    ans=float("inf")
    a,b=map(int,input().split())
    if b<(t+1):
        ans=min(a,ans)

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

Fixed code:
n,t=map(int,input().split())
ans=float("inf")
for i in range(n):
    a,b=map(int,input().split())
    if b<(t+1):
        ans=min(a,ans)

if ans==float("inf"):
    print("TLE")
else:
    print(ans)
Buggy code:
N,limit = map(int,input().split())
for i in range(N):
	c,t = map(int,input().split())

	costs = []
	if limit >= t:
		costs.append(c)

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

Fixed code:
N,limit = map(int,input().split())
costs = []
for i in range(N):
	c,t = map(int,input().split())
	if limit >= t:
		costs.append(c)

if len(costs) == 0:
	print("TLE")
else:
	print(min(costs))
Buggy code:
N,T=map(int,input().split())
cc=1000
for i in range(N):
  c,t=map(int,input().split())
  if cc>c and T=>t:
    cc=c
if cc==1000:
  print("TLE")
else:
  print(cc)

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

input = sys.stdin.readline


def main():
    n, t = map(int, input().split())
    routes = filter(
        lambda x: x[1] <= t, [list(map(int, input().split())) for _ in range(n)]
    )
    if routes:
        print(min(routes)[0])
    else:
        print("TLE")


if __name__ == "__main__":
    main()


Fixed code:
import sys

input = sys.stdin.readline


def main():
    n, t = map(int, input().split())
    routes = list(
        filter(lambda x: x[1] <= t, [list(map(int, input().split())) for _ in range(n)])
    )
    if routes:
        print(min(routes)[0])
    else:
        print("TLE")


if __name__ == "__main__":
    main()
Buggy code:
N,T = map(int,input().split())
paths = []
for i in range(N):
  cost, time = map(int,input().split())
  if time < T:
    paths.append(cost)
if len(paths) == 0:
  print("TLE")
else:
  print(min(paths))
    


Fixed code:
N,T = map(int,input().split())
paths = []
for i in range(N):
  cost, time = map(int,input().split())
  if time <= T:
    paths.append(cost)
if len(paths) == 0:
  print("TLE")
else:
  print(min(paths))
Buggy code:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    n , T =f()

    minc = 10000
    for i in range(n):
        c,t = f()
        if t<= T:
            mic = min(minc, c)
    
    if minc == 10000:
        print('TLE')
    else:
        print(minc)

solve()

Fixed code:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    n , T =f()

    minc = 10000
    for i in range(n):
        c,t = f()
        if t<= T:
            minc = min(minc, c)
    
    if minc == 10000:
        print('TLE')
    else:
        print(minc)

solve()
Buggy code:
n,t=map(int,input().split())
d=0
c=1000
for i in range(n):
  a,s=map(int,input().split())
  if s<=t and c>=a:
    c=a
    d=i+1
if d==0:
  print("TLE")
else:
  print(d)
    

Fixed code:
n,t=map(int,input().split())
d=0
c=1000
for i in range(n):
  a,s=map(int,input().split())
  if s<=t and c>=a:
    c=a
    d=i+1
if d==0:
  print("TLE")
else:
  print(c)
Buggy code:
I=lambda:map(int,input())
n,k=I()
s=1001
for i in range(n):
  a,b=I()
  if b<=k:
    s=min(s,a)
if s==1001:
  print('TLE')
else:
  print(s)

Fixed code:
I=lambda:map(int,input().split())
n,k=I()
s=1001
for i in range(n):
  a,b=I()
  if b<=k:
    s=min(s,a)
if s==1001:
  print('TLE')
else:
  print(s)
Buggy code:
n,t=map(int,input().split())
l=[]
m=[]
for i in range(1,n+1):
  p,q=map(int,input().split())
  if q<=t:
    l[i]=p
    m[i]=q
  else:
    pass
if len(l)==0:
  print("TLE")
else:
  print(min(l))
  


Fixed code:
n,t=map(int,input().split())
l=[]
for i in range(1,n+1):
  p,q=map(int,input().split())
  if q<=t:
    l.append(p)
  else:
    pass
if len(l)==0:
  print("TLE")
else:
  print(min(l))
Buggy code:
N, T = map(int, input().split())
ct = [list(map(int, input().split())) for i in range(N)]
ans = 10000000
for i in ct:
    if i[1] <= T:
        ans = min(i[0], ans)

print(ans)


Fixed code:
N, T = map(int, input().split())
ct = [list(map(int, input().split())) for i in range(N)]
ans = 10000000
for i in ct:
    if i[1] <= T:
        ans = min(i[0], ans)
if ans == 10000000:
    ans = "TLE"
print(ans)
Buggy code:
n,t = map(int,input().split())
out = 1001
o = t+1
outnum = 1001
for i in range(n):
  c, tim = map(int,input().split())
  if tim < t and c < out:
    out = c
    outnum = i
if outnum == 1001:
  print('TLE')
else:
  print(outnum)

Fixed code:
n,t = map(int,input().split())
out = 1001
o = t+1
outnum = 1001
for i in range(n):
  c, tim = map(int,input().split())
  if tim <= t and c < out:
    out = c
    outnum = i
if outnum == 1001:
  print('TLE')
else:
  print(out)
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)
  
min_cost = 10**5
for i in range(N):
  if t[i]<=T and min_cost>c[i]:
    min_cost=c[i]

if min_cost==10**3:
  print("TLE")
else:
  print(min_cost)

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)
  
min_cost = 10**4
for i in range(N):
  if t[i]<=T and min_cost>c[i]:
    min_cost=c[i]

if min_cost==10**4:
  print("TLE")
else:
  print(int(min_cost))
Buggy code:
N, T = map(int, input().split())

minimize = 10000
for i in range(N):
    c_i, t_i = map(int, input().split())
    if t_i < T and c_i < minimize:
        minimize = c_i

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

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

minimize = 10000
index = 0
for i in range(N):
    c_i, t_i = map(int, input().split())
    if t_i <= T and c_i < minimize:
        minimize = c_i

if minimize == 10000:
    print('TLE')
else:
    print(minimize)
Buggy code:
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 != 10000 else "TLE")

Fixed code:
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")
Buggy code:
n, t = map(int, input().split())
e = [[int(i) for i in input().split()] for i in range(n)] 

min = float("inf")
index = 0
for i,v in enumerate(e):
    if v[1] <= t:
        if v[1] <= min:
            min = v[1]
            index = v[0]
            


if min == float("inf"):
    print("TLE")
else :
    print(index)

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

min = float("inf")
cost = 5000
for i,v in enumerate(e):
    if v[1] <= t:
        if v[0] <= cost:
            min = v[1]
            cost = v[0]
            


if min == float("inf"):
    print("TLE")
else :
    print(cost)
Buggy code:
n,T = map(int,input().split())
ans = 2000
for i in range(n):
  c,t = map(int,input().split())
  if t <= T:
    ans = min(ans, t)
if ans == 2000:
  print('TLE')
else:
  print(ans)


Fixed code:
n,T = map(int,input().split())
ans = 2000
for i in range(n):
  c,t = map(int,input().split())
  if t <= T:
    ans = min(ans, c)
if ans == 2000:
  print('TLE')
else:
  print(ans)
Buggy code:
n,t = map(int, input().split())
k = [list(map(int, input().split())) for i in range(n)]
mincost=1000000
for i in range(n):
  if k[i][-1]<=t:
    cost=k[i][0]
    mincost=min(mincost,cost)
  
print(mincost)

Fixed code:
n,t = map(int, input().split())
k = [list(map(int, input().split())) for i in range(n)]
mincost=1000000

for i in range(n):
  if k[i][-1]<=t:
    cost=k[i][0]
    mincost=min(mincost,cost)
if mincost==1000000:
  print("TLE")
else:
  print(mincost)
Buggy code:
#112
n, t0 = map(int, input().split())
ans = 10000000000
for _ in range(n):
    c, t = map(int, input().split())
    if(t<=t0 and c<=ans):
        ans = c
if(ans==10000000000):
    print("TLE")
else:
    print(c)

Fixed code:
#112
n, t0 = map(int, input().split())
ans = 10000000000
for _ in range(n):
    c, t = map(int, input().split())
    if(t<=t0 and c<=ans):
        ans = c

if(ans==10000000000):
    print("TLE")
else:
    print(ans)
Buggy code:
n,t = map(int,input().split())
d = []

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

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

for i in range(n):
    c,s = map(int,input().split())
    if s <= t:
        d.append(c)
if d== []:
    print("TLE")
else:
    print(min(d))
Buggy code:
import sys, re
from math import ceil, floor, sqrt, pi, factorial#, gcd
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
# input = sys.stdin.readline 
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 __name__ == '__main__':
    main()


Fixed code:
import sys, re
from math import ceil, floor, sqrt, pi, factorial#, gcd
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
# input = sys.stdin.readline 
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()
Buggy code:
N,T=map(int,input().split())

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

print(ans)

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

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

print(ans)
Buggy code:
n, t = map(int, input().split())
minCost = 1001
for i range in n:
    cc, tt = map(int, input().split())
    if tt <= t and cc < minCost:
        minCost = cc
if minCost == 1001:
    print('TLE')
else:
    print(minCost)

Fixed code:
n, t = map(int, input().split())
minCost = 1001
for i in range(n):
    cc, tt = map(int, input().split())
    if tt <= t and cc < minCost:
        minCost = cc
if minCost == 1001:
    print('TLE')
else:
    print(minCost)
Buggy code:
n,t=map(int,input().split())
ct=[list(map(int,input().split())) for _ in range(n)]
mc=100000
for i in range(n):
    if ct[i][1]<=t:
        if ct[i][0]<mc:
            mc=ct[i][0]
if mi==-1:
    print("TLE")
else:
    print(mc)

Fixed code:
n,t=map(int,input().split())
ct=[list(map(int,input().split())) for _ in range(n)]
mc=100000
for i in range(n):
    if ct[i][1]<=t:
        if ct[i][0]<mc:
            mc=ct[i][0]
if mc==100000:
    print("TLE")
else:
    print(mc)
Buggy code:
n, t = map(int, input().split())

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

min = 1001
for x, y in a:
  if x < min and y < t:
    min = x

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

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

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

min = 1001
for x, y in a:
  if x < min and y <= t:
    min = x

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

Fixed code:
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')
Buggy code:
N, T = map(int, input().split())

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

if min_c != 1001:
    print(min_c)
else:
    print('TLE')


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

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

if min_c != 1001:
    print(min_c)
else:
    print('TLE')
Buggy code:
n,t=map(int,input().split())
ct=[list(map(int,input().split())) for i in range(n)]
a=[]
for j in ct:
  if j[1]<t:
    a.append(j[0])
if len(a)==0:
  print("TLE")
else:
  print(min(a))

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


Fixed code:
N,T=map(int,input().split())
a=[]
for i in range(N):
    c,t=map(int,input().split())
    if t<=T:
        a.append(c)
if len(a)==0:
    print('TLE')
else:
    a.sort()
    print(a[0])
Buggy code:
N, T = list(map(int, input().split()))
minc = 1001;
for i in range(N):
  c, t = list(map(int, input().split()))
  if(t <= T and c < minc):
    minc = 0
if(minc == 1001):
  print("TLE")
else:
  print(minc)

Fixed code:
N, T = list(map(int, input().split()))
minc = 1001;
for i in range(N):
  c, t = list(map(int, input().split()))
  if(t <= T and c < minc):
    minc = c
if(minc == 1001):
  print("TLE")
else:
  print(minc)
Buggy code:
n,lim = map(int,input().split())

ans = 10000

for i in range(n):
    cost,time = map(int,input().split())
    
    if time <= lim and cost < ans:
        ans = cost

if ans != 10000:
    print("TLE")
else:
    print(ans)

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

ans = 10000

for i in range(n):
    cost,time = map(int,input().split())
    
    if time <= lim and cost < ans:
        ans = cost

if ans == 10000:
    print("TLE")
else:
    print(ans)
Buggy code:
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
print(ans)

Fixed code:
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)
Buggy code:
def p_b():
    N, T = map(int, input().split())
    ans = 10 ** 9
    for _ in range(N):
        c, t = map(int, input().split())
        if t <= T:
            ans = min(ans, c * t)
    print(ans if ans != 10 ** 9 else "TLE")
    
p_b()

Fixed code:
def p_b():
    N, T = map(int, input().split())
    ans = 10 ** 9
    for _ in range(N):
        c, t = map(int, input().split())
        if t <= T:
            ans = min(ans, c)
    print(ans if ans != 10 ** 9 else "TLE")
    
p_b()
Buggy code:
n,t = map(int, input().split())
y = 10**5
c = [list(map(int,input().split())) for i in range(n)]
for i in range(n):
    if c[i][1]<t:
        y=min(y,c[i][0])
if y != 10**5:
    print(y)
else:
    print("TLE")

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

Fixed code:
n,t = map(int, input().split())
y = 10**5
for i in range(n):
    c,x = map(int,input().split())
    if x<=t:
        y=min(y,c)
if y != 10**5:
    print(y)
else:
    print("TLE")
Buggy code:
N,T=map(int,input().split())
ans=100000
for _ in range(N):
  c,t=map(int,input().split())
  if t<=T:
    ans=min(ans,c)
print('TLE' if ans=100000 else ans)

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

C = []

for _ in range(N):
  c,t = map(int,input().split())
  if t < T:
    L = [c,t]
    C.append(L)
    
C = sorted(C,key = lambda x:x[1])

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

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

C = []

for _ in range(N):
  c,t = map(int,input().split())
  if t <= T:
    L = [c,t]
    C.append(L)
    
C = sorted(C,key = lambda x:x[0])

if len(C) == 0:
  print("TLE")
else:print(C[0][0])
Buggy code:
n,t = map(int,input().split())
m = 9999
for i in range(n):
  c,y = map(int,input().split())
  if y<t:
    m=min(m,c)
print("TLE" if m==9999 else m)

Fixed code:
n,t = map(int,input().split())
m = 9999
for i in range(n):
  c,y = map(int,input().split())
  if y<=t:
    m=min(m,c)
print("TLE" if m==9999 else m)
Buggy code:
# coding : UTF-8
from sys import stdin

N,T = map(int,stdin.readline().rstrip().split())
#ct_list = [ list(map(int,stdin.readline().rstrip().split())) for i in range(N) ]
c_list = []
for i in range(N):
    C = stdin.readline().rstrip().split()
    if int(C[1]) < T:
        c_list.append(int(C[0]))

def main():
    print( "TLE" if len(c_list) == 0 else min(c_list) )

if __name__ == '__main__' :
    main()

Fixed code:
# coding : UTF-8
from sys import stdin

N,T = map(int,stdin.readline().rstrip().split())
#ct_list = [ list(map(int,stdin.readline().rstrip().split())) for i in range(N) ]
c_list = []
for i in range(N):
    C = stdin.readline().rstrip().split()
    if int(C[1]) <= T:
        c_list.append(int(C[0]))

def main():
    print( "TLE" if len(c_list) == 0 else min(c_list) )

if __name__ == '__main__' :
    main()
Buggy code:
N,T=input().split()
min=1001
for i in range(N):
  cost,time=input().split()
  if time<=T and cost<min:
    min=cost
if min==1001:
  print('TLE')
else:
  print(min)

Fixed code:
N,T=input().split()
min=1001
for i in range(int(N)):
  cost,time=input().split()
  if int(time)<=int(T) and int(cost)<min:
    min=int(cost)
if min==1001:
  print('TLE')
else:
  print(min)