qyliang/CodeNanoFix huggingface dataset:
Buggy code:
N,T=map(int,input().split())
flag=1001
for _ in range(N):
    c,t=map(int,input().split())
    if t>T:
        continue
    else:
        count=c
        if count<=flag:
            flag=count
print(c)


Fixed code:
N,T=map(int,input().split())
flag=1001
for _ in range(N):
    c,t=map(int,input().split())
    if t>T:
        continue
    else:
        count=c
        if count<=flag:
            flag=count

if flag==1001:
    print("TLE")
else:
    print(flag)
Buggy code:
NT = list(map(int, input().split()))
N = NT[0]
T = NT[1]
l = []
for i in range(N):
    l.append(list(map(int, input().split())))

lf = list(filter(lambda x: x[1] <= T, l))

if(len(lf) == 0):
    print('TLE')
else:
    ls = sorted(lf, key=lambda x: x[0])
    print(l.index(ls[0]) + 1)

Fixed code:
NT = list(map(int, input().split()))
N = NT[0]
T = NT[1]
l = []
for i in range(N):
    l.append(list(map(int, input().split())))

lf = list(filter(lambda x: x[1] <= T, l))

if(len(lf) == 0):
    print('TLE')
else:
    ls = sorted(lf, key=lambda x: x[0])
    print(ls[0][0])
Buggy code:
n,t = map(int,input().split())
m = 10000
for i in range(n):
    c,d = map(int,input().split())
    if d <= t:
        if m > c:
            m = c
if m = 10000:
    print('TLE')
else:
    print(m)

Fixed code:
n,t = map(int,input().split())
m = 10000
for i in range(n):
    c,d = map(int,input().split())
    if d <= t:
        if m > c:
            m = c
if m == 10000:
    print('TLE')
else:
    print(m)
Buggy code:
N, T = map(int, input().split())
i = 1001

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

if i == 1001:
  print('TLE')
else:
  print(c)

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

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

if i == 1001:
  print('TLE')
else:
  print(i)
Buggy code:
N, T = list(map(int, input().split()))
ans=10000

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

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

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

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

if ans==10000:
  print('TLE')
else:
  print(ans)
Buggy code:
import numpy as np

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

s = np.array([])

for i in range(N):
    s = np.append(s, np.array(list(map(int, input().split()))))

s = s.reshape((N, 2))

pos = np.where(s[:, 1] <= T)

if pos[0].shape == (0,):
    print('TLE')
else:
    np.sort(s[pos], axis=0)
    print(int(s[0][0]))

Fixed code:
import numpy as np


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

s = np.array([])

for i in range(N):
    s = np.append(s, np.array(list(map(int, input().split()))))

s = s.reshape((N, 2))

pos = np.where(s[:, 1] <= T)

if pos[0].shape == (0,):
    print('TLE')
else:
    print(int(np.sort(s[pos], axis=0)[0][0]))
Buggy code:
N, T = map(int, input().split())
c = 1001
for i in range(N):
  c, t = map(int, input().split())
  if t <= T:
    ans = min(ans, c)
print(ans) if c < 1001 else print("TLE")

Fixed code:
N, T = map(int, input().split())
ans = 1001
for i in range(N):
  c, t = map(int, input().split())
  if t <= T:
    ans = min(ans, c)
print(ans) if ans < 1001 else print("TLE")
Buggy code:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
N,T = [int(x) for x in input().split]
cost = []
for _ in range(n):
    c,t = [int(x) for x in input().split]
    if t <= T:
        cost.append(c)

if cost == True:
    print(min(cost))
else:
    print("TLE")

Fixed code:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
N,T = [int(x) for x in input().split()]
cost = []
for _ in range(N):
    c,t = [int(x) for x in input().split()]
    if t <= T:
        cost.append(c)

if cost:
    print(min(cost))
else:
    print("TLE")
Buggy code:
n, T = map(int, input().split())
out = list()
for _ in range(n):
    c, t = map(int, input().split())
    # if t > T: continue
    out.append((c, t))
print(min(out)[0]) if out and min(out)[0] <= T else print("TLE")

Fixed code:
n, T = map(int, input().split())
out = list()
for _ in range(n):
    c, t = map(int, input().split())
    if t > T: continue
    out.append((c, t))
print(min(out)[0]) if out and min(out)[1] <= T else print("TLE")
Buggy code:
n,T=map(int,input().split())
l=[]
for i in range(n):
    l.append(list(map(int,input().split())))
c=[]
t=[]
for i in range(n):
    c.append(l[i][0])
    t.append(l[i][1])

c_n=[]
t_n=[]
for i in range(n):
    if t[i]<=T:
        c_n.append(c[i])
        t_n.append(t[i])

if len(c_n)==0:
    print("TLE")
else:
    for i in range(len(c_n)):
        if t_n[i]==max(t_n):
            print(c_n[i])
            break




Fixed code:
n,T=map(int,input().split())
l=[]
for i in range(n):
    l.append(list(map(int,input().split())))
c=[]
t=[]
for i in range(n):
    c.append(l[i][0])
    t.append(l[i][1])

c_n=[]
t_n=[]
for i in range(n):
    if t[i]<=T:
        c_n.append(c[i])
        t_n.append(t[i])

if len(c_n)==0:
    print("TLE")
else:
    for i in range(len(c_n)):
        if c_n[i]==min(c_n):
            print(c_n[i])
            break
Buggy code:
ct=[]
for i in range(N):
    ct.append(list(map(int, input().strip().split(' '))))
    
tle=True
c=100000000

for i in range(N):
    if ct[i][1]<=T:
        tle=False
        c=min(c,ct[i][0])
        
if tle:
    print('TLE')
else:
    print(c)

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

ct=[]
for i in range(N):
    ct.append(list(map(int, input().strip().split(' '))))
    
tle=True
c=100000000

for i in range(N):
    if ct[i][1]<=T:
        tle=False
        c=min(c,ct[i][0])
        
if tle:
    print('TLE')
else:
    print(c)
Buggy code:
#-*- coding:utf-8 -*- 

def main():
	N, T = map(int,input().split())
	c_list = []
	t_list = []
	for i in range(N):
		c, t = map(int,input().split())
		c_list.append(c)
		t_list.append(t)
	
	index_list = []
	for i in range(N):
		if t_list[i] < T:
			index_list.append(i)
	
	#print(index_list)
	
	if len(index_list) == 0:
		return print("TLE")

	cost_min = float("inf")
	for i in range(len(index_list)):
		if c_list[i] < cost_min:
			cost_min = c_list[i]
	
	print(int(cost_min))
	

if __name__ == "__main__":
	main()


Fixed code:
#-*- coding:utf-8 -*- 

def main():
	N, T = map(int,input().split())
	c_list = []
	t_list = []
	for i in range(N):
		c, t = map(int,input().split())
		c_list.append(c)
		t_list.append(t)
	
	#print(t_list)
	#print(type(t_list[0]))
	index_list = []
	for i in range(len(t_list)):
		if t_list[i] <= T:
			index_list.append(i)
	
	#print(index_list)
	
	if len(index_list) == 0:
		return print("TLE")

	cost_min = float("inf")
	for i in index_list:
		if c_list[i] < cost_min:
			cost_min = c_list[i]
	
	print(int(cost_min))
	

if __name__ == "__main__":
	main()
Buggy code:
a,b=input().split()
a=int(a)
b=int(b)
c=[input().split() for i in range(a)]
d=1001
for i in range(a-1):
  if int(c[i][1])<=b:
    if d>int(c[i][0]):
      d=int(c[i][0])
if d==1001:
  print("TLE")
else:
  print(d)
      

Fixed code:
a,b=input().split()
a=int(a)
b=int(b)
c=[input().split() for i in range(a)]
d=1001
for i in range(a):
  if int(c[i][1])<=b:
    if d>int(c[i][0]):
      d=int(c[i][0])
if d==1001:
  print("TLE")
else:
  print(d)
Buggy code:
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, key=lambda x: x[1])
for i in cts:
    if i[1] > t:
        pass
    else:
        res = i[0]
        break
print(res)


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

Fixed code:
N, T = map(int, input().split())
min_cost = 2000
for i in range(N):
    c, t = map(int, input().split())
    if t <= T:
        min_cost = min(min_cost, c)
        
if min_cost == 2000:
    print("TLE")
else:
    print(min_cost)
Buggy code:
N, T = input().split()
N, T = int(N), int(T)
R = [input().split() for i in range(N)]

for i, r in enumerate(R):
  R[i] = [int(r[0]), int(r[1])]

R_sorted = sorted(R, key = lambda x: x[0])

List = []
answer = 'TLE'

for r in R_sorted:
  if r[1] <= T:
    List.append(r[0])

print(min(List))

Fixed code:
N, T = input().split()
N, T = int(N), int(T)
R = [input().split() for i in range(N)]
 
for i, r in enumerate(R):
  R[i] = [int(r[0]), int(r[1])]
 
R_sorted = sorted(R, key = lambda x: x[0])
 
List = []
answer = 'TLE'
 
for r in R_sorted:
  if r[1] <= T:
    List.append(r[0])

if List:
  answer = min(List)

print(answer)
Buggy code:
N,T=map(int,input().split())
s=2000
for i in range(N):
    a,b=map(int,input().split())
    if b<=T:s=min(s,a)
print(s if ans<2000 else "TLE")


Fixed code:
N,T=map(int,input().split())
ans=2000
for i in range(N):
    a,b=map(int,input().split())
    if b<=T:ans=min(ans,a)
print(ans if ans<2000 else "TLE")
Buggy code:
N,T=map(int,input().split())
root=[tuple(map(int,input().split())) for i in range(N)]

minc=1000
for cand in range(N):
    if cand[1]<=T:
        if cand[0]<minc:
            minc=cand[0]
if minc==1000:
    print("TLE")
else:
    print(minc)

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

minc=1001
for cand in root:
    if cand[1]<=T:
        if cand[0]<minc:
            minc=cand[0]
if minc==1001:
    print("TLE")
else:
    print(minc)
Buggy code:
n,t = map(int,input().split())
ct_list = []
less = []

for _ in range(n):
    a,b = map(int,input().split())
    if b < t:
        less.append(a)

if less:
    print(min(less))
else:
    print('TLE')

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

for _ in range(n):
    a,b = map(int,input().split())
    if b <= t:
        less.append(a)

if less:
    print(min(less))
else:
    print('TLE')
Buggy code:
import numpy as np,math,itertools
n,t=map(int,input().split())
ct=[list(map(int,input().split())) for i in range(n)]
p=[]
for i in range(n):
    if ct[i][1]<t:
        p+=[ct[i][0]]
if p!=[]:print(min(p))
else:print("TLE")

Fixed code:
import numpy as np,math,itertools
n,t=map(int,input().split())
ct=[list(map(int,input().split())) for i in range(n)]
p=[]
for i in range(n):
    if ct[i][1]<=t:
        p+=[ct[i][0]]
if p!=[]:print(min(p))
else:print("TLE")
Buggy code:
from operator import itemgetter

def main():
	n, t = map(int, input().split())

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

	costs = sorted(costs, key=itemgetter(0))
	if costs[0][1]>t:
		print("TLE")
		return
	for i in range(n):
		if costs[i][1] > t:
			print("TLE")
			return
		if costs[i][1] <= t:
			print(costs[i][0])
			return

main()

Fixed code:
from operator import itemgetter

def main():
	n, t = map(int, input().split())

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

	costs = sorted(costs, key=itemgetter(0))
	for i in range(n):
		if costs[i][1] <= t:
			print(costs[i][0])
			return
	print("TLE")
	return

main()
Buggy code:
N, T = map(int, input().split())
a = 9999
for _ in N:
    c, t = map(int, input().split())
    if t <= T:
        a = min(a, c)
if a == 9999:
    print('TLE')
else:
    print(a)


Fixed code:
N, T = map(int, input().split())
a = 9999
for _ in range(N):
    c, t = map(int, input().split())
    if t <= T:
        a = min(a, c)
if a == 9999:
    print('TLE')
else:
    print(a)
Buggy code:
N,T=list(map(int, input().split()))
a=10**5
for _ in range(N):
  c,t=list(map(int, input().split()))
  if t<=T:
    a=min(c.a)
if a==10**5:
  print('TLE')
else:
  print(c)

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


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



Fixed code:
N,T = map(int,input().split())
time_list = []
for i in range(N):
    c,t = map(int,input().split())
    if t <= T:
        time_list.append(c)
if len(time_list) >= 1:
    print(min(time_list))
else:
    print('TLE')
Buggy code:
# -*- coding: utf-8 -*-


def main():
    """Function."""
    n, t = map(int, input().split())

    min_val = 1001
    for _ in range(n):
        ci, ti = map(int, input().split())

        if ti < t:
            if ci < min_val:
                min_val = ci
            else:
                pass
        else:
            pass

    print(min_val)


if __name__ == "__main__":
    main()


Fixed code:
# -*- coding: utf-8 -*-


def main():
    """Function."""
    n, t = map(int, input().split())

    min_val = 1001
    for _ in range(n):
        ci, ti = map(int, input().split())

        if ti <= t:
            if ci < min_val:
                min_val = ci
            else:
                pass
        else:
            pass

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


if __name__ == "__main__":
    main()
Buggy code:
n, t = map(int, input().strip().split())
ans = 1e9
for i in range(n):
  x, y = map(int, input().strip().split())
  if y <= t:
    x = min(x, ans)
print(ans if ans < 1e6 else 'TLE')


Fixed code:
n, t = map(int, input().strip().split())
ans = 1e9
for i in range(n):
  x, y = map(int, input().strip().split())
  if y <= t:
    ans = min(x, ans)
print(ans if ans < 1e6 else 'TLE')
Buggy code:
N, T = list(map(int, input().split()))
paris = []
for i in range(N):
  c, t = list(map(int, input().split()))
  if t<=T:
    pairs.append((c, t))
if len(pairs)==0:
  print('TLE')
else:
  print(sorted(pairs, key=lambda p:p[0])[0][0])

Fixed code:
N, T = list(map(int, input().split()))
pairs = []
for i in range(N):
  c, t = list(map(int, input().split()))
  if t<=T:
    pairs.append((c, t))
if len(pairs)==0:
  print('TLE')
else:
  print(sorted(pairs, key=lambda p:p[0])[0][0])
Buggy code:
N,T = map(int, input().split())
ans = 1005
for i in range(N):
    c,t = map(int, input().split())
    if t <= T:
        ans = min(ans, c)
print("TLE" if m == 1005 else ans)


Fixed code:
N,T = map(int, input().split())
ans = 1005
for i in range(N):
    c,t = map(int, input().split())
    if t <= T:
        ans = min(ans, c)
print("TLE" if ans == 1005 else ans)
Buggy code:
N, T = [int(x) for x in input().strip()]

ok = 2000
for _ in range(N):
  c, t = [int(x) for x in input().strip()]
  if t <= T:
    ok = min(ok, c)

print("TLE" if ok == 2000 else ok)


Fixed code:
N, T = [int(x) for x in input().split()]

ok = 2000
for _ in range(N):
  c, t = [int(x) for x in input().split()]
  if t <= T:
    ok = min(ok, c)

print("TLE" if ok == 2000 else ok)
Buggy code:
n, t = map(int, input().split())
ct = [list(map(int,input().split())) for _ in range(n)]

li = []
for i in range(n):
  if ct[i][1] < t:
    li.append(ct[i])
  else:
    continue

if len(li) > 0:
  li2 = []
  for i in range(len(li)):
    li2.append(li[i][0])
  print(min(li2))
else:
  print("TLE")

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

li = []
for i in range(n):
  if ct[i][1] <= t:
    li.append(ct[i])
  else:
    continue

if len(li) > 0:
  li2 = []
  for i in range(len(li)):
    li2.append(li[i][0])
  print(min(li2))
else:
  print("TLE")
Buggy code:
N,T = map(int,input().split())
ctlist = [list(map(int,input().split())) for _ in range(N)]

minimum_cost = 1001

for sub_list in ctlist:
    if sub_list[1] <= T:
        if sub_list[0] < minimum_cost:
            minimum_cost = sub_list[0]

if minimum_cost == 1001:
    print("TLE")
print(minimum_cost)


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

minimum_cost = 1001

for sub_list in ctlist:
    if sub_list[1] <= T:
        if sub_list[0] < minimum_cost:
            minimum_cost = sub_list[0]

if minimum_cost == 1001:
    print("TLE")
else:
    print(minimum_cost)
Buggy code:
N,T=map(int,input().split())
list=[input() for _ in range(N)]

list1=[]
for i in range(N):
    X,Y=map(int,list[i].split(" "))
    if Y < T:
        list1.append(X)
print(min(list1))

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

list1=[]
for i in range(N):
    X,Y=map(int,list[i].split(" "))
    if Y <= T:
        list1.append(X)
print(min(list1) if list1 != [] else "TLE")
Buggy code:
N, T = map(int, input().split())
flag = False
min_cost = 1000
for i in range(N):
    c,t = map(int, input().split())
    if t < T:
        flag = True
        min_cost = min(c,min_cost)
print(min_cost if flag else "TLE")

Fixed code:
N, T = map(int, input().split())
flag = False
min_cost = 1000
for i in range(N):
    c,t = map(int, input().split())
    if t <= T:
        flag = True
        min_cost = min(c,min_cost)
print(min_cost if flag else "TLE")
Buggy code:
N,T  = map(int,input().split())
Ans = T
for item in range(N):
    C = input().split()
    if int(C[1]) <= T:
        Ans = min(Ans,int(C[0]))
        
if Ans > T:
    print ("TLE")
else:
    print(Ans)

Fixed code:
N,T  = map(int,input().split())
AnsC = 9999
for item in range(N):
    C = input().split()
    if int(C[1]) <= T:
        AnsC = min(AnsC,int(C[0]))
        
#print(AnsC)
#print(T)
if AnsC >= 1001:
    print ("TLE")
else:
    print(AnsC)
Buggy code:
N, T = map(int, input().split())
A = []
for i in range(N):
    temp , B = map(int, input().split())
    if B <= T:
        A.append(temp)
if not A:
    print("TLE")
else:
    print(A.min())

Fixed code:
N, T = map(int, input().split())
A = []
for i in range(N):
    temp , B = map(int, input().split())
    if B <= T:
        A.append(temp)
if not A:
    print("TLE")
else:
    print(min(A))
Buggy code:
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(ans if ans < T else "TLE")


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

ans = 1e9

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

if ans == 1e9:
    print("TLE")
else:
    print(ans)
Buggy code:
N, T = list(map(int, input().split()))

path = []
for _ in range(N):
  c, t = list(map(int, input().split()))
  if t <= T:
    path.append(c)
sort(path)
reverse(path)
if len(path) > 0:
  print(path[0])
else:
  print(path[0])

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

path = []
for _ in range(N):
  c, t = list(map(int, input().split()))
  if t <= T:
    path.append(c)
path.sort()
if len(path) > 0:
  print(path[0])
else:
  print('TLE')
Buggy code:
n, t = list(map(int,input().split()))
list1 = []
list2 = []
for i in range(0,int(n)):
  list1.append(list(map(int, input().split())))

for i in list1:
  if int(i[1]) <= int(t):
    list2.append(i)

list2.sort()
print(list2[0][0])

Fixed code:
n, t = list(map(int,input().split()))
list1 = []
list2 = []
for i in range(0,n):
  list1.append(list(map(int, input().split())))

for i in list1:
  if int(i[1]) <= t:
    list2.append(i)

if(list2):
  list2.sort()
  print(list2[0][0])
else:
  print("TLE")
Buggy code:
N,T=map(int,input().split())
p=[]
for _ in range(N):
  c=list(map(int,input().split()))
  p.append(c)
ans=9999
for c in p:
  if c[1]<T:
    if c[0]<ans:
      ans=c[0]
if ans==9999:
  print('TLE')
else:
  print(ans)

Fixed code:
N,T=map(int,input().split())
p=[]
for _ in range(N):
  c=list(map(int,input().split()))
  p.append(c)
ans=9999
for c in p:
  if c[1]<=T:
    if c[0]<ans:
      ans=c[0]
if ans==9999:
  print('TLE')
else:
  print(ans)
Buggy code:
N, T = map(int, input.split())
c_max = 1001

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

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

anslist=[nt[0] for nt in ntlist if nt[1]<=t]
if ans==[]:
  print("TLE")
else:
  print(min(ans))

Fixed code:
[n,t]=list(map(int,input().split()))
ntlist=[list(map(int,input().split())) for _ in range(n)]
 
anslist=[nt[0] for nt in ntlist if nt[1]<=t]
if anslist==[]:
  print("TLE")
else:
  print(min(anslist))
Buggy code:
n,t = map(int,input().split())
lis = [list(map(int,input().split())) for x in range(n)]

lis = sorted(lis)
def TimeLimit(lis):
    for x in lis:
        if t > x[1]:
            print(x[0])
            return
    else:
        print('TLE')
TimeLimit(lis)


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

lis = sorted(lis)
def TimeLimit(lis):
    for x in lis:
        if t >= x[1]:
            print(x[0])
            return
    else:
        print('TLE')
TimeLimit(lis)
Buggy code:
# -*- coding: utf-8 -*-

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_min = 100000

for i in range(n):
    if cost_min > c[i] and t[i] <= T:
        cost_min = c[i]

print(cost_min)


Fixed code:
# -*- coding: utf-8 -*-

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_min = 100000

for i in range(n):
    if cost_min > c[i] and t[i] <= T:
        cost_min = c[i]

if cost_min == 100000:
    print("TLE")
else:
    print(cost_min)
Buggy code:
n, T = map(int, input().split())

mini = 10**9
flg = False
for i in range(n):
    c, t = map(int, input().split())
    if T > t:
        flg = True
        if mini > t:
            ans = c
if flg: print(c)
else: print('TLE')

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

ans = 10**9
flg = False
for i in range(n):
    c, t = map(int, input().split())
    if T >= t:
        flg = True
        ans = min(ans, c)
if flg: print(ans)
else: print('TLE')
Buggy code:
n,t=map(int,input().split())
c=0
for _ in range(n):
  a,b=map(int,input().split())
  if b<=t:
    c=min(c,a)
print("TLE" if c==0 else c)

Fixed code:
n,t=map(int,input().split())
c=1001
for _ in range(n):
  a,b=map(int,input().split())
  if b<=t:
    c=min(c,a)
print("TLE" if c==1001 else c)
Buggy code:
N,T = int(input().split())
C = 2000
for i in range(N):
  c,t = int(input().split())
  if t <= T:
    C = min(c,C)
    
if C == 2000:
  print("TLE")
else: print(C)

Fixed code:
N,T = (int(x) for x in input().split())
C = 2000
for i in range(N):
  c,t = (int(x) for x in input().split())
  if t <= T:
    C = min(c,C)
    
if C == 2000:
  print("TLE")
else: print(C)
Buggy code:
n,t = map(int,input().split())

dic = {}
for val in range(n):
    c,ti = map(int,input().split())
    if ti <= t:
        dic[c] = ti

if dic == {}:
    print("TLE")
    exit()

# sort
dic = sorted(dic.items() ,key=lambda x:x[1])
print(dic[0][0])


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

dic = {}
for val in range(n):
    c,ti = map(int,input().split())
    if ti <= t:
        dic[c] = ti

if dic == {}:
    print("TLE")
    exit()

# sort
dic = sorted(dic.items() ,key=lambda x:x[0])
print(dic[0][0])
Buggy code:
n, T = map(int, input().split())
a = 1001
for i in range(n):
  c, t = map(int, input().split())
  if t < T:
    a = min(a.c)
if a == 1001:
  print("TLE")
else:
  print(a)

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