Buggy python submission (verdict: Runtime Error):
N = int(input())
x = [0] * N
y = [0] * N
h = [0] * N
for i in range(N):
    x[i], y[i], h[i] = map(int, input().split())

top = [[] for _ in range(101*101)]

for i in range(101):
    for j in range(101):
        top[i*101+j] = [i, j]

#print(top)

H = 0

for i in range(len(top)):
    topx = top[i][0]
    topy = top[i][1]
    H = 0
    h_list = []
    for j in range(N):
        tmp = abs(topx - x[j]) + abs(topy - y[j]) + h[j]
        h_list.append(tmp)
    if h_list.count(h_list[0]) >= N - h.count(0) :
        ansx = topx
        ansy = topy
        ansH = h_list[0]
        break

print(ansx, ansy, ansH)


Fixed submission:
N = int(input())
x = [0] * N
y = [0] * N
h = [0] * N
for i in range(N):
    x[i], y[i], h[i] = map(int, input().split())

top = [[] for _ in range(101*101)]

for i in range(101):
    for j in range(101):
        top[i*101+j] = [i, j]

#print(top)

H = 0
ansx = -100

for i in range(len(top)):
    topx = top[i][0]
    topy = top[i][1]
    H = 0
    h_list = []
    for j in range(N):
        tmp = abs(topx - x[j]) + abs(topy - y[j]) + h[j]
        h_list.append(tmp)
    if h_list.count(h_list[0]) == N :
        ansx = topx
        ansy = topy
        ansH = h_list[0]
        break

if ansx == -100:
    for i in range(len(top)):
        topx = top[i][0]
        topy = top[i][1]
        H = 0
        h_list = []
        for j in range(N):
            if h[j] != 0:
                tmp = abs(topx - x[j]) + abs(topy - y[j]) + h[j]
                h_list.append(tmp)
        if h_list.count(h_list[0]) == N - h.count(0) :
            ansx = topx
            ansy = topy
            ansH = h_list[0]
            break

print(ansx, ansy, ansH)

Buggy python submission (verdict: Runtime Error):
N = int(input())
x = [0] * N
y = [0] * N
h = [0] * N
for i in range(N):
    x[i], y[i], h[i] = map(int, input().split())

top = [[] for _ in range(101*101)]

for i in range(101):
    for j in range(101):
        top[i*101+j] = [i, j]

#print(top)

H = 0

for i in range(len(top)):
    topx = top[i][0]
    topy = top[i][1]
    H = 0
    h_list = []
    for j in range(N):
        tmp = abs(topx - x[j]) + abs(topy - y[j]) + h[j]
        h_list.append(tmp)
    if h_list.count(h_list[0]) == N :
        ansx = topx
        ansy = topy
        ansH = h_list[0]
        break

print(topx, topy, ansH)


Fixed submission:
N = int(input())
x = [0] * N
y = [0] * N
h = [0] * N
for i in range(N):
    x[i], y[i], h[i] = map(int, input().split())

top = [[] for _ in range(101*101)]

for i in range(101):
    for j in range(101):
        top[i*101+j] = [i, j]

#print(top)

H = 0
ansx = -100

for i in range(len(top)):
    topx = top[i][0]
    topy = top[i][1]
    H = 0
    h_list = []
    for j in range(N):
        tmp = abs(topx - x[j]) + abs(topy - y[j]) + h[j]
        h_list.append(tmp)
    if h_list.count(h_list[0]) == N :
        ansx = topx
        ansy = topy
        ansH = h_list[0]
        break

if ansx == -100:
    for i in range(len(top)):
        topx = top[i][0]
        topy = top[i][1]
        H = 0
        h_list = []
        for j in range(N):
            if h[j] != 0:
                tmp = abs(topx - x[j]) + abs(topy - y[j]) + h[j]
                h_list.append(tmp)
        if h_list.count(h_list[0]) == N - h.count(0) :
            ansx = topx
            ansy = topy
            ansH = h_list[0]
            break

print(ansx, ansy, ansH)