qyliang/CodeNanoFix huggingface dataset:
Buggy code:
n, T = map(int, input().split())
res = 2e3
for _ in range(n):
    c, t = map(int, input().split())
    if t < T:
        res = min(c, res)
if res < 2e3:
    print(res)
else:
    print('TLE')

Fixed code:
n, T = map(int, input().split())
res = 2e3
for _ in range(n):
    c, t = map(int, input().split())
    if t <= T:
        res = min(c, res)
if res < 2e3:
    print(res)
else:
    print('TLE')
Buggy code:
a, b = map(int, input().split())
e = []
for i in range(a):
    c, d = map(int, input().split())
    if b>=d:
        e.append(c)
print(min(e) if not e == [] else "ELT")

Fixed code:
a, b = map(int, input().split())
e = []
for i in range(a):
    c, d = map(int, input().split())
    if b>=d:
        e.append(c)
print(min(e) if not e == [] else "TLE")
Buggy code:
N, T = map(int, input().split())
ct = []
for _ in range(N):
    ct.append(list(map(int,input().split())))

ans = 1001
for i in ct:
    if T > i[1]:
        ans = min(ans, i[0])

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

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

ans = 1001
for i in ct:
    if T >= i[1]:
        ans = min(ans, i[0])

if ans == 1001:
    print('TLE')
else:
    print(ans)
Buggy code:
N,T=map(int,input().split(' '))
costs = []
for i in range(N):
  c,t = map(int,input().split(' '))
  if t<=T:
    costs.append(c)
print(min(costs))

Fixed code:
N,T=map(int,input().split(' '))
costs = []
for i in range(N):
  c,t = map(int,input().split(' '))
  if t<=T:
    costs.append(c)
if costs == []:
  print('TLE')
else:
  print(min(costs))
Buggy code:
N, T = map(int, input.split())
c = [None] * N
t = [None] * N

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

a = [x for x, y in zip(c, t) if y <= T]
if len(a) > 0:
  print(min(a))
else:
  print('TLE')

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

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

a = [x for x, y in zip(c, t) if y <= T]
if len(a) > 0:
  print(min(a))
else:
  print('TLE')
Buggy code:
d = list(map(int,(input().strip().split(' '))))
N = d[0]
T = d[1]
min = 10000
for i in range(0, N-1):
    d = list(map(int,input().strip().split(' ')))
    c = d[0]
    t = d[1]
    if t <= T:
        if min >= c:
            min = c
if min == 10000:
    print("TLE")
else:
    print(min)


Fixed code:
d = list(map(int,(input().strip().split(' '))))
N = d[0]
T = d[1]
min = 100000000
for i in range(0, N):
    d = list(map(int,input().strip().split(' ')))
    c = d[0]
    t = d[1]
    if t <= T:
        if min >= c:
            min = c
if min == 100000000:
    print("TLE")
else:
    print(min)
Buggy code:
n = list(map(int, input().strip().split(' ')))
b = n[1]
h = 100000
c = 100000
int(c)
a = []
for i in range(n[0]):
  a.append(list(map(int, input().split())))
  if a[i][1] <= n[1] and a[i][0] <= c:
    h = a[i][1]
    c = a[i][0]
    

print(h)
print(c)
if h < n[1]:
  print(c)
else:
    print("TLE")

Fixed code:
n = list(map(int, input().strip().split(' ')))
b = n[1]
h = 100000
c = 100000
int(c)
a = []
for i in range(n[0]):
  a.append(list(map(int, input().split())))
  if a[i][1] <= n[1] and a[i][0] <= c:
    h = a[i][1]
    c = a[i][0]
    

if h <= n[1]:
  print(c)
else:
    print("TLE")
Buggy code:
# input
N, T = map(int, input().split())
rhr = []
r_append = rhr.append
for i in range(1, N + 1):
    c, t = map(int, input().split())
    r_append(
        {
            "index": i,
            "cost": c,
            "time": t
        }
    )

target_routes = [
    r
    for r in rhr
    if r["time"] < T
]

if not target_routes:
    print("TLE")
else:
    rhr.sort(key=lambda x: x["cost"] / x["time"])
    print(rhr[0]["index"])

Fixed code:
# input
N, T = map(int, input().split())
rhr = []
r_append = rhr.append
for i in range(1, N + 1):
    c, t = map(int, input().split())
    r_append(
        {
            "index": i,
            "cost": c,
            "time": t
        }
    )

target_routes = [
    r
    for r in rhr
    if r["time"] <= T
]

if not target_routes:
    print("TLE")
else:
    target_routes.sort(key=lambda x: x["cost"])
    print(target_routes[0]["cost"])
Buggy code:
N, T = map(int, input().split())
c = [input().split() for _ in range(N)]
num = 9999

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

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

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

if num == 9999:
  print('TLE')
else:
  print(num)
Buggy code:
n,t = map(int,input().split())
ma = 1001
for i in range(n):
    c,ti = map(int,input().split())
    if ti < t+1:
        if c< ma: ma=c
print(ma if ma !=1000 else"TLE")

Fixed code:
n,t = map(int,input().split())
ma = 1001
for i in range(n):
    c,ti = map(int,input().split())
    if ti < t+1:
        if c< ma: ma=c
print(ma if ma !=1001 else"TLE")
Buggy code:
n,T=map(int,input().split())
a = []
for i in range(n):
  A,t=map(int,input().split())
  if t > T:
    pass
  else:
    a.append(A)
print(min(a))

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

Fixed code:
N,T = map(int,input().split())
ans = [int(c) for c,t in [(input().split()) for i in range(N)] if int(t)<=T]
if len(ans)!=0:
    print(min(ans))
else:
    print("TLE")
Buggy code:
# -*- coding: utf-8 -*-
"""
Created on Sat Oct  6 14:05:15 2018

@author: rgraptin
"""

params = input()

n = int(params.split(' ')[0])
t = int(params.split(' ')[1])

data = []

for i in range(0, n) :
    d = input()
    data.append([int(d.split(' ')[0]),int(d.split(' ')[1])])
    
minimum_cost = 1000000
    
for cost in data :
    if cost[1] <= t : 
        
        if cost[0] < minimum_cost :
            print (cost)
            minimum_cost = cost[0]

if minimum_cost == 1000000:
    print ("TLE")
else :
    print (minimum_cost)

Fixed code:
# -*- coding: utf-8 -*-
"""
Created on Sat Oct  6 14:05:15 2018

@author: rgraptin
"""

params = input()

n = int(params.split(' ')[0])
t = int(params.split(' ')[1])

data = []

for i in range(0, n) :
    d = input()
    data.append([int(d.split(' ')[0]),int(d.split(' ')[1])])
    
minimum_cost = 1000000
    
for cost in data :
    if cost[1] <= t : 
        
        if cost[0] < minimum_cost :
            minimum_cost = cost[0]

if minimum_cost == 1000000:
    print ("TLE")
else :
    print (minimum_cost)
Buggy code:
N,T = [int(x) for x in input().split()]
ans =100000000
for i in range(N):
  c,t =[int(x) for x in input().split()]
  if t<=T:
    ans = min(c,ans)
if ans!=100000000
    print(ans)
else:
  print("TLE")

Fixed code:
N,T = [int(x) for x in input().split()]
ans =100000000
for i in range(N):
  c,t =[int(x) for x in input().split()]
  if t<=T:
    ans = min(c,ans)
if ans!=100000000:
  print(ans)
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)
  
if m==1001: print("TLE")
else: print(c)

Fixed 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)
  
if m==1001: print("TLE")
else: print(m)
Buggy code:
from __future__ import print_function
# import numpy as np
# import numpypy as np
import sys
import math
import string
import fractions
import re
import array
import copy
import functools
import operator

import collections
import itertools
import bisect
import heapq


from heapq import heappush
from heapq import heappop

# from itertools import accumulate
# from collections import deque
import random




def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)


def main():
    n,t = map(int, input().split())
    minx=sys.maxsize
    for i in range(n):
        cc,tt = map(int, input().split())
        if tt<=t:
            minx = cc if cc<minx else minx
    print(minx)
    
if __name__ == '__main__':
    main()


Fixed code:
from __future__ import print_function
# import numpy as np
# import numpypy as np
import sys
import math
import string
import fractions
import re
import array
import copy
import functools
import operator

import collections
import itertools
import bisect
import heapq


from heapq import heappush
from heapq import heappop

# from itertools import accumulate
# from collections import deque
import random




def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)


def main():
    n,t = map(int, input().split())
    minx=sys.maxsize
    for i in range(n):
        cc,tt = map(int, input().split())
        if tt<=t:
            minx = cc if cc<minx else minx
    if minx<sys.maxsize:
        print(minx)
    else:
        print("TLE")



if __name__ == '__main__':
    main()
Buggy code:
N, T = 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")


Fixed code:
N, T = 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")
Buggy code:

n,T = map(int,input().split())
ct = [list(map(int,input().split())) for _ in range(n)]
li = []
for k in ct:
    if k[1]<=T:
        li += [k[0]]
print(min(li))


Fixed code:
n,T = map(int,input().split())
ct = [list(map(int,input().split())) for _ in range(n)]
li = []
for k in ct:
    if k[1]<=T:
        li += [k[0]]
if li ==[]:
    print("TLE")
else:
    print(min(li))
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(m,c)
print("TLE" if cost==1001 else m)

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("TLE" if cost==1001 else cost)
Buggy code:
n,T=map(int,input().split())
c_l=[]
t_l=[]
for i in range(n):
	c,t=map(int,input().split())
	if t>T:
		c=1001
	c_l.append(c)
	t_l.append(t)
print("TLE") if min(c_l) == 1001 else min(c_l)

Fixed code:
n,T=map(int, input().split())
c_l =[]
t_l=[]
for i in range(n):
    c,t=map(int,input().split())
    if t<=T:
        c_l.append(c)
        t_l.append(t)

if c_l == []:
    print("TLE")
else:
    print(min(c_l))
Buggy code:
#!/usr/bin/env python3

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n,T = LI()
ct = [LI() for _ in range(n)]
ct.sort()
for c,t in ct:
    if t < T:
        print(c)
        quit()
print('TLE')

Fixed code:
#!/usr/bin/env python3

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n,T = LI()
ct = [LI() for _ in range(n)]
ct.sort()
for c,t in ct:
    if t <= T:
        print(c)
        quit()
print('TLE')
Buggy code:
N , T  = map(int,input().split())
result = 1001
while N >0:
 a,b = map(int,input().split())
 if b < T and a < result:
  result = a
 N = N - 1
if result == 1001:
 print('TLE')
else:
 print(result)

Fixed code:
N , T  = map(int,input().split())
result = 1001
while N > 0:
 a,b = map(int,input().split())
 if b <= T and a < result:
  result = a
 N = N - 1
if result == 1001:
 print('TLE')
else:
 print(result)
Buggy code:
import sys
def input():
    return sys.stdin.readline()[:-1]
n,t=map(int,input().split())
ct=[list(map(int,input().split())) for i in range(n)]
ans=float('inf')
for i in range(n):
    if ct[i][1]<=t:
        ans=min(ans,ct[i][0])
print(ans)

Fixed code:
import sys
def input():
    return sys.stdin.readline()[:-1]
n,t=map(int,input().split())
ct=[list(map(int,input().split())) for i in range(n)]
ans=float('inf')
for i in range(n):
    if ct[i][1]<=t:
        ans=min(ans,ct[i][0])
if ans==float('inf'):
    print("TLE")
else:
    print(ans)
Buggy code:
N, T = [int(i) for i in input().split()]
ct = []
for j in range(N):
  ct.append([int(i) for i in input().split()])
ct.sort()
flag = 0
for i in range(N):
  if ct[i][1] < T:
    print(ct[i][0])
    flag = 1
    break
if flag == 0:
  print("TLE")

Fixed code:
N, T = [int(i) for i in input().split()]
ct = []
for j in range(N):
  ct.append([int(i) for i in input().split()])
ct.sort()
flag = 0
for i in range(N):
  if ct[i][1] <= T:
    print(ct[i][0])
    flag = 1
    break
if flag == 0:
  print("TLE")
Buggy code:
import numpy as np

dataNum, timeMax = input().strip().split(' ')
dataNum, timeMax = [int(dataNum), int(timeMax)]

cost = []
time = []

for i in range(dataNum):
    A, B = list(map(int, input().strip().split(' ')))
    cost.append(A)
    time.append(B)

if min(time) > timeMax:
    print('TLE')
else :
    print(cost[np.argmin(time)])

Fixed code:
import numpy as np

dataNum, timeMax = input().strip().split(' ')
dataNum, timeMax = [int(dataNum), int(timeMax)]

cost = [10000]
time = [10000]

"""
for i in range(dataNum):
    A, B = list(map(int, input().strip().split(' ')))   
    cost.append(A)
    time.append(B)

if min(time) > timeMax:
    print('TLE')
else :
    print(min(cost))
"""
for i in range(dataNum):
    A, B = list(map(int, input().strip().split(' ')))   
    if B <= timeMax:
        cost.append(A)
        time.append(B)
    
if min(time) > timeMax:
    print('TLE')
else :
    print(min(cost))
Buggy code:
n, T = list(map(int, input().split()))
ans = 10000
for i in range(n):
    c, t = list(map(int, input().split()))
    if t > T:
        continue
    else:
        ans = min(ans, c)
print(ans)


Fixed code:
n, T = list(map(int, input().split()))
ans = 10000
for i in range(n):
    c, t = list(map(int, input().split()))
    if t > T:
        continue
    else:
        ans = min(ans, c)
if ans == 10000:
    print('TLE')
else:
    print(ans)
Buggy code:
n, *XYH = map(int, open(0).read().split())
for cx, cy in product(range(101), repeat=2):
    B, C = set(), set()
    for x, y, h in zip(XYH[::3], XYH[1::3], XYH[2::3]):
        s = h + abs(x-cx) + abs(y-cy)
        if h:
            C.add(s)
        else:
            B.add(s)
    if len(C) == 1:
        h = C.pop()
        if all(h <= b for b in B):
            print(cx, cy, h)
            exit()

Fixed code:
from itertools import product
n, *XYH = map(int, open(0).read().split())
for cx, cy in product(range(101), repeat=2):
    B, C = set(), set()
    for x, y, h in zip(XYH[::3], XYH[1::3], XYH[2::3]):
        s = h + abs(x-cx) + abs(y-cy)
        if h:
            C.add(s)
        else:
            B.add(s)
    if len(C) == 1:
        h = C.pop()
        if all(h <= b for b in B):
            print(cx, cy, h)
            exit()
Buggy code:
n, *XYH = map(int, open(0).read().split())
X, Y, H = XYH[::3], XYH[1::3], XYH[2::3]
A = []
for cx, cy in product(range(101), repeat=2):
    B = set()
    C = set()
    for x, y, h in zip(X, Y, H):
        s = h + abs(x-cx) + abs(y-cy)
        if h == 0:
            B.add(s)
        else:
            C.add(s)
    if len(C) == 1:
        h = C.pop()
        if all(h <= b for b in B):
            A.append((cx, cy, h))
print(*A.pop())

Fixed code:
from itertools import product
n, *XYH = map(int, open(0).read().split())
X, Y, H = XYH[::3], XYH[1::3], XYH[2::3]
A = []
for cx, cy in product(range(101), repeat=2):
    B = set()
    C = set()
    for x, y, h in zip(X, Y, H):
        s = h + abs(x-cx) + abs(y-cy)
        if h == 0:
            B.add(s)
        else:
            C.add(s)
    if len(C) == 1:
        h = C.pop()
        if all(h <= b for b in B):
            A.append((cx, cy, h))
print(*A.pop())
Buggy code:
a = int(input())

b = []

p = 0
pp = 0
ppp = 0
for i in range(a):
    b.append(list(map(int,input().split())))

for i in range(0,101,-1):
    for j in range(0,101,-1):
        for k in range(a):
            if k == 0:
                p = abs(b[k][0] - i) + abs(b[k][1]-j)+b[k][2]
            else:
                if max(0,p - abs(b[k][0]-i)- abs(b[k][1]-j)) != b[k][2]:
                    pp = 1
        if pp == 0:
            ppp = 1
            break
        else:
            pp = 0
    if ppp == 1:
        print(i,j,p)
        break

Fixed code:
a = int(input())

b = []

p = 0
pp = 0
ppp = 0

for i in range(a):
    b.append(list(map(int,input().split())))
b.sort(key=lambda x:-x[2])
for i in range(0,101):
    for j in range(0,101):
        for k in range(a):
            if k == 0:
                p = abs(b[k][0] - i) + abs(b[k][1]-j)+b[k][2]
            else:
                if max(0,p - abs(b[k][0]-i)- abs(b[k][1]-j)) != b[k][2]:
                    pp = 1
        if pp == 0:
            ppp = 1
            break
        else:
            pp = 0
    if ppp == 1:
        print(i,j,p)
        break
Buggy code:
from math import *

N = int(input())
all_input_list = [list(map(int, input().split())) for i in range(N)]
x_y_h = [all_input_list[i] for i in range(N) if all_input_list[i][2] > 0][0]
for cx in range(101):
    flag = 1
    for cy in range(101):
        H = x_y_h[2] + abs(cx - x_y_h[0]) + abs(cy - x_y_h[1])
        for input_list in all_input_list:
            if (input_list[2] != max(H - abs(cx - input_list[0]) - abs(cy - input_list[1]), 0)):
                flag = 0
                break
        if (flag == 1):
            print("%s %s %s" % (cx, cy, H))
            break
    if (flag == 1):
        break

Fixed code:
from math import *

N = int(input())
all_input_list = [list(map(int, input().split())) for i in range(N)]
x_y_h = [all_input_list[i] for i in range(N) if all_input_list[i][2] > 0][0]
for cx in range(101):
    for cy in range(101):
        flag = 1
        H = x_y_h[2] + abs(cx - x_y_h[0]) + abs(cy - x_y_h[1])
        for input_list in all_input_list:
            if (input_list[2] != max(H - abs(cx - input_list[0]) - abs(cy - input_list[1]), 0)):
                flag = 0
                break
        if (flag == 1):
            print("%s %s %s" % (cx, cy, H))
            break
    if (flag == 1):
        break
Buggy code:
n = int(input())

clues = [tuple(map(int, input().split())) 
         for _i in range(n)]
good_clue = next(clue for clue in clues if clue[2] > 0)

centers = [(x, y) 
           for x in range(101) 
           for y in range(101)]
for cx, cy in centers:
    ch = good_clue[2] \
         + abs(good_clue[0] - cx) \
         + abs(good_clue[1] - cy)

    if all(h != max(ch - abs(x - cx) - abs(y - cy), 0) 
           for x, y, h in clues):
        print(cx, cy, ch)
        break

Fixed code:
n = int(input())

clues = [tuple(map(int, input().split()))
         for _i in range(n)]
good_clue = next(clue for clue in clues if clue[2] > 0)

centers = [(x, y)
           for x in range(101)
           for y in range(101)]
for cx, cy in centers:
    ch = good_clue[2] \
         + abs(good_clue[0] - cx) \
         + abs(good_clue[1] - cy)

    if all(h == max(ch - abs(x - cx) - abs(y - cy), 0)
           for x, y, h in clues):
        print(cx, cy, ch)
        break
Buggy code:
N = int(input())

x = []
y = []
h = []
for i in range(N):
    x_, y_, h_ = map(int, input().split())
    x.append(x_)
    y.append(y_)
    h.append(h_)

for i in range(0,101):
    for j in range(0,101):
        for hn in h:
            if hn > 0:
                tmph = hn + abs(i-x[n]) + abs(j-y[n])
                break
        count = 0
        for n in range(N):
            count += 1
            if h[n] != max(tmph - abs(i-x[n]) - abs(j-y[n]), 0):
                break
            if count == N:
                print(str(i) + ' ' + str(j) + ' ' + str(tmph))


Fixed code:
N = int(input())

x = []
y = []
h = []
for i in range(N):
    x_, y_, h_ = map(int, input().split())
    x.append(x_)
    y.append(y_)
    h.append(h_)

for i in range(0,101):
    for j in range(0,101):
        for n, hn in enumerate(h):
            if hn > 0:
                tmph = hn + abs(i-x[n]) + abs(j-y[n])
                break
        count = 0
        for n in range(N):
            count += 1
            if h[n] != max(tmph - abs(i-x[n]) - abs(j-y[n]), 0):
                break
            if count == N:
                print(str(i) + ' ' + str(j) + ' ' + str(tmph))
Buggy code:
def check():
    for k in range(0,n):
        if h[k]!=0:
            break
    for i in range(0,101):
        for j in range(0,101):
            flag=True
            h1=abs(i-x[k])+abs(j-y[k])+h[k]
            for l in range(k+1,n):
                if h[l]!=max(h1-abs(i-x[l])-abs(j-y[l]),0)
                    flag=False
                    break
            if flag==True:
                print(i,j,h1)
                return
            
n=int(input())
x=[0 for i in range(0,n)]
y=[0 for i in range(0,n)]
h=[0 for i in range(0,n)]
for i in range(0,n):
    x[i],y[i],h[i]=map(int,input().split())
check()

Fixed code:
def check():
    for k in range(0,n):
        if h[k]!=0:
            break
    for i in range(0,101):
        for j in range(0,101):
            flag=True
            h1=abs(i-x[k])+abs(j-y[k])+h[k]
            for l in range(0,n):
                if h[l]!=max(h1-abs(i-x[l])-abs(j-y[l]),0):
                    flag=False
                    break
            if flag==True:
                print(i,j,h1)
                return
            
n=int(input())
x=[0 for i in range(0,n)]
y=[0 for i in range(0,n)]
h=[0 for i in range(0,n)]
for i in range(0,n):
    x[i],y[i],h[i]=map(int,input().split())
check()
Buggy code:
import sys
N = int(input())
X = []
Y = []
H = []
for i in range(N):
    x, y, h = map(int, input().split())
    X.append(x)
    Y.append(y)
    H.append(h)
x1 = X[0]
y1 = Y[0]
h1 = H[0]
for Cx in range(101):
    for Cy in range(101):
        h = h1 + abs(x1-Cx) + abs(y1-Cy)
        i = 1
        while i < N and H[i] == max(h - abs(X[i]-Cx) + abs(Y[i]-Cy), 0):
            i += 1
        if i == N:
            print(Cx, Cy, h)
            sys.exit()

Fixed code:
import sys
N = int(input())
X = []
Y = []
H = []
for i in range(N):
    x, y, h = map(int, input().split())
    X.append(x)
    Y.append(y)
    H.append(h)
while H[0] == 0:
    X.append(X[0])
    Y.append(Y[0])
    H.append(H[0])
    X = X[1:]
    Y = Y[1:]
    H = H[1:]
x1 = X[0]
y1 = Y[0]
h1 = H[0]
for Cx in range(101):
    for Cy in range(101):
        h = h1 + abs(x1-Cx) + abs(y1-Cy)
        i = 1
        while i < N and H[i] == max(h - abs(X[i]-Cx) - abs(Y[i]-Cy), 0):
            i += 1
        if i == N:
            print(Cx, Cy, h)
            sys.exit()