Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
XYH = [[int(x) for x in input().split()] for _ in range(N)]

def get_cands(x, y, h):
    if h > 0:
        for xc in range(100 + 1):
            for yc in range(100 + 1):
                hc = h + abs(xc - x) + abs(yc - y)
                yield (xc, yc, hc)
    else:
        for xc in range(100 + 1):
            for yc in range(100 + 1):
                hc = h + abs(xc - x) + abs(yc - y)
                for hc2 in range(1, hc + 1):
                    yield (xc, yc, hc2)

cand = set(get_cands(*XYH[0]))

for x, y, h in XYH[1:]:
    new_cand = set(get_cands(x, y, h))
    cand &= new_cand
print(*next(iter(cand)))

Fixed submission:
N = int(input())
XYH = [[int(x) for x in input().split()] for _ in range(N)]

def get_cands(x, y, h):
    for xc in range(100 + 1):
        for yc in range(100 + 1):
            hc = h + abs(xc - x) + abs(yc - y)
            yield (xc, yc, hc)

def is_valid(top, view):
    xt, yt, ht = top
    xv, yv, hv = view
    return hv == max(0, ht - abs(xt - xv) - abs(yt - yv))

cand = set(get_cands(*next(filter(lambda x: x[2] > 0, XYH))))
ans = filter(lambda x: all(is_valid(x, v) for v in XYH), cand)

print(*next(ans))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

def get_cands(x, y, h):
    if h > 0:
        for xc in range(100 + 1):
            for yc in range(100 + 1):
                hc = h + abs(xc - x) + abs(yc - y)
                if hc <= 10**9:
                    yield (xc, yc, hc)
    else:
        for xc in range(100 + 1):
            for yc in range(100 + 1):
                hc = h + abs(xc - x) + abs(yc - y)
                for hc2 in range(1, hc + 1):
                    if hc <= 10**9:
                        yield (xc, yc, hc2)

x1, y1, h1 = map(int, input().split())
cand = set(get_cands(x1, y1, h1))

for _ in range(N - 1):
    new_cand = set()
    x, y, h = map(int, input().split())
    for c in get_cands(x, y, h):
        if c in cand:
            new_cand.add(c)
    cand = new_cand
    if len(cand) == 1:
        break
if len(cand) == 1:
    print(*next(iter(cand)))
else:
    while True:
        pass

Fixed submission:
N = int(input())
XYH = [[int(x) for x in input().split()] for _ in range(N)]

def get_cands(x, y, h):
    for xc in range(100 + 1):
        for yc in range(100 + 1):
            hc = h + abs(xc - x) + abs(yc - y)
            yield (xc, yc, hc)

def is_valid(top, view):
    xt, yt, ht = top
    xv, yv, hv = view
    return hv == max(0, ht - abs(xt - xv) - abs(yt - yv))

cand = set(get_cands(*next(filter(lambda x: x[2] > 0, XYH))))
ans = filter(lambda x: all(is_valid(x, v) for v in XYH), cand)

print(*next(ans))

Buggy python submission (verdict: Runtime Error):
N = int(input())

def get_cands(x, y, h):
    for xc in range(100 + 1):
        for yc in range(100 + 1):
            yield (xc, yc, h + abs(xc - x) + abs(yc - y))

x1, y1, h1 = map(int, input().split())
cand = set(get_cands(x1, y1, h1))

for _ in range(N - 1):
    new_cand = set()
    x, y, h = map(int, input().split())
    for c in get_cands(x, y, h):
        if c in cand:
            new_cand.add(c)
    cand = new_cand
    if len(cand) == 1:
        break
print(*next(iter(cand)))

Fixed submission:
N = int(input())
XYH = [[int(x) for x in input().split()] for _ in range(N)]

def get_cands(x, y, h):
    for xc in range(100 + 1):
        for yc in range(100 + 1):
            hc = h + abs(xc - x) + abs(yc - y)
            yield (xc, yc, hc)

def is_valid(top, view):
    xt, yt, ht = top
    xv, yv, hv = view
    return hv == max(0, ht - abs(xt - xv) - abs(yt - yv))

cand = set(get_cands(*next(filter(lambda x: x[2] > 0, XYH))))
ans = filter(lambda x: all(is_valid(x, v) for v in XYH), cand)

print(*next(ans))