Buggy python submission (verdict: Runtime Error):
N = int(input().strip())
x = []
y = []
h = []
for i in range(0, N):
    xi, yi, hi= [int(a) for a in input().strip().split()]
    x.append(xi)
    y.append(yi)
    h.append(hi)

def calc_H():
    for Cx in range(0, 101):
        for Cy in range(0, 101):
            H = -1
            for i in range(0, N):
                Hi = h[i] + abs(x[i]-Cx) + abs(y[i]-Cy)
                if H == -1:
                    H = Hi

                if h[i] == 0:
                    if H < Hi:
                        break
                elif H != Hi:
                    break

                if i == N-1:
                    return Cx, Cy, H

print(*calc_H())

Fixed submission:
N = int(input().strip())
xyh = []
for i in range(0, N):
    xi, yi, hi= [int(a) for a in input().strip().split()]
    xyh.append((xi, yi, hi))

xyh.sort(key = lambda t: t[2], reverse = True)

def calc_H():
    for Cx in range(0, 101):
        for Cy in range(0, 101):
            H = -1
            for i in range(0, N):
                Hi = xyh[i][2] + abs(xyh[i][0]-Cx) + abs(xyh[i][1]-Cy)
                if H == -1:
                    H = Hi

                if xyh[i][2] == 0:
                    if H > Hi:
                        break
                elif H != Hi:
                    break

                if i == N-1:
                    return Cx, Cy, H

print(*calc_H())

Buggy python submission (verdict: Runtime Error):
N = int(input().strip())
x = []
y = []
h = []
for i in range(0, N):
    xi, yi, hi= [int(a) for a in input().strip().split()]
    x.append(xi)
    y.append(yi)
    h.append(hi)

def calc_H():
    for Cx in range(0, 101):
        for Cy in range(0, 101):
            H = -1
            for i in range(0, N):
                Hi = h[i] + abs(x[i]-Cx) + abs(y[i]-Cy)
                if H == -1:
                    H = Hi

                if h[i] == 0:
                    if H > Hi:
                        break
                elif H != Hi:
                    break

                if i == N-1:
                    return Cx, Cy, H

print(*calc_H())

Fixed submission:
N = int(input().strip())
xyh = []
for i in range(0, N):
    xi, yi, hi= [int(a) for a in input().strip().split()]
    xyh.append((xi, yi, hi))

xyh.sort(key = lambda t: t[2], reverse = True)

def calc_H():
    for Cx in range(0, 101):
        for Cy in range(0, 101):
            H = -1
            for i in range(0, N):
                Hi = xyh[i][2] + abs(xyh[i][0]-Cx) + abs(xyh[i][1]-Cy)
                if H == -1:
                    H = Hi

                if xyh[i][2] == 0:
                    if H > Hi:
                        break
                elif H != Hi:
                    break

                if i == N-1:
                    return Cx, Cy, H

print(*calc_H())

Buggy python submission (verdict: Runtime Error):
N = int(input().strip())
x = []
y = []
h = []
for i in range(0, N):
    xi, yi, hi= [int(a) for a in input().strip().split()]
    x.append(xi)
    y.append(yi)
    h.append(hi)

def calc_H():
    for Cx in range(0, 101):
        for Cy in range(0, 101):
            H = -1
            for i in range(0, N):
                if h[i] == 0:
                    continue
                Hi = h[i] + abs(x[i]-Cx) + abs(y[i]-Cy)
                if H == -1:
                    H = Hi
                if H != Hi:
                    break
                if i == N-1:
                    return Cx, Cy, H

print(*calc_H())

Fixed submission:
N = int(input().strip())
xyh = []
for i in range(0, N):
    xi, yi, hi= [int(a) for a in input().strip().split()]
    xyh.append((xi, yi, hi))

xyh.sort(key = lambda t: t[2], reverse = True)

def calc_H():
    for Cx in range(0, 101):
        for Cy in range(0, 101):
            H = -1
            for i in range(0, N):
                Hi = xyh[i][2] + abs(xyh[i][0]-Cx) + abs(xyh[i][1]-Cy)
                if H == -1:
                    H = Hi

                if xyh[i][2] == 0:
                    if H > Hi:
                        break
                elif H != Hi:
                    break

                if i == N-1:
                    return Cx, Cy, H

print(*calc_H())