Buggy python submission (verdict: Runtime Error):
W = 101

def solve(N, xyh):
    H = [[1e9] * W for i in range(W)]
    for x, y, h in xyh:
        for yy in range(W):
            for xx in range(W):
                if h == 0:
                    d = abs(xx - x) + abs(yy - y)
                    H[yy][xx] = min(H[yy][xx], d)
    V = [[-1] * W for i in range(W)]
    for x, y, h in xyh:
        for yy in range(W):
            for xx in range(W):
                d = abs(xx - x) + abs(yy - y)
                if h + d > H[yy][xx]:
                    V[yy][xx] = -2
                else:
                    if V[yy][xx] == -1:
                        V[yy][xx] = d + h
                    elif V[yy][xx] != d + h:
                        V[yy][xx] = -2
    for yy in range(W):
        for xx in range(W):
            if 1 <= V[yy][xx]:
                return (xx, yy, V[yy][xx])

if __name__ == '__main__':
    N = int(input())
    xyh = [tuple(map(int, input().split())) for i in range(N)]
    print(*solve(N, xyh))

Fixed submission:
W = 101

def solve(xyh):
    for bx, by, bh in xyh:
        if bh > 0:
            break
    for yy in range(W):
        for xx in range(W):
            H = bh + abs(bx - xx) + abs(by - yy)
            for x, y, h in xyh:
                if max(H - abs(xx - x) - abs(yy - y), 0) != h:
                    break
            else:
                return (xx, yy, H)

N = int(input())
xyh = [tuple(map(int, input().split())) for i in range(N)]
print(*solve(xyh))

Buggy python submission (verdict: Runtime Error):
W = 101

def solve(N, xyh):
    for yy in range(W):
        for xx in range(W):
            H = set()
            Z = 1e9
            for x, y, h in xyh:
                d = abs(xx - x) + abs(yy - y)
                if h > 0:
                    H.add(d + h)
                else:
                    Z = min(Z, d)
            if len(H) == 1:
                h = H.pop()
                if 0 < h <= Z:
                    return (xx, yy, h)

N = int(input())
xyh = [tuple(map(int, input().split())) for i in range(N)]
print(*solve(N, xyh))

Fixed submission:
W = 101

def solve(xyh):
    for bx, by, bh in xyh:
        if bh > 0:
            break
    for yy in range(W):
        for xx in range(W):
            H = bh + abs(bx - xx) + abs(by - yy)
            for x, y, h in xyh:
                if max(H - abs(xx - x) - abs(yy - y), 0) != h:
                    break
            else:
                return (xx, yy, H)

N = int(input())
xyh = [tuple(map(int, input().split())) for i in range(N)]
print(*solve(xyh))

Buggy python submission (verdict: Runtime Error):
W = 101

def solve(N, xyh):
    for yy in range(W):
        for xx in range(W):
            H = set()
            Z = W ** 2 # INF
            for x, y, h in xyh:
                d = abs(xx - x) + abs(yy - y)
                if h > 0:
                    H.add(d + h)
                else:
                    Z = min(Z, d)
            if len(H) == 1:
                h = H.pop()
                if h <= Z:
                    return (xx, yy, h)

N = int(input())
xyh = [tuple(map(int, input().split())) for i in range(N)]
print(*solve(N, xyh))

Fixed submission:
W = 101

def solve(xyh):
    for bx, by, bh in xyh:
        if bh > 0:
            break
    for yy in range(W):
        for xx in range(W):
            H = bh + abs(bx - xx) + abs(by - yy)
            for x, y, h in xyh:
                if max(H - abs(xx - x) - abs(yy - y), 0) != h:
                    break
            else:
                return (xx, yy, H)

N = int(input())
xyh = [tuple(map(int, input().split())) for i in range(N)]
print(*solve(xyh))