Buggy python submission (verdict: Runtime Error):
n = int(input())
if n == 1:
    x, y, h = map(int, input().split())
    print(x, y, h)
    exit()
for _ in range(n):
    s = [list(map(int, input().split())) for _ in range(n)]
    for i in range(101):
        for j in range(101):
            h = -1
            ok = 1
            for t in s:
                if t[2] == 0:
                    ok += 1
                elif h == -1:
                    h = abs(t[0] - i) + abs(t[1] - j) + t[2]
                else:
                    h0 = abs(t[0] - i) + abs(t[1] - j) + t[2]
                    if h == h0:
                        ok += 1
            if ok == n:
                ok = 0
                for t in s:
                    if h == abs(t[0] - i) + abs(t[1] - j) + t[2] or (t[2] == 0 and abs(t[0] - i) + abs(t[1] - j) <= h):
                        ok += 1
                if ok == n:
                    print(i, j, h)
                    exit()

Fixed submission:
n = int(input())
if n == 1:
    x, y, h = map(int, input().split())
    print(x, y, h)
    exit()
s = [list(map(int, input().split())) for _ in range(n)]
for i in range(101):
    for j in range(101):
        h = -1
        ok = 1
        for t in s:
            if t[2] == 0:
                ok += 1
            elif h == -1:
                h = abs(t[0] - i) + abs(t[1] - j) + t[2]
            else:
                h0 = abs(t[0] - i) + abs(t[1] - j) + t[2]
                if h == h0:
                    ok += 1
        if ok == n:
            for t in s:
                if abs(t[0] - i) + abs(t[1] - j) <= h:
                    if not h == abs(t[0] - i) + abs(t[1] - j) + t[2]:
                        ok = 0
                else:
                    if not t[2] == 0:
                        ok = 0
            if ok == n:
                print(i, j, h)
                exit()

Buggy python submission (verdict: Runtime Error):
n = int(input())
if n == 1:
    x, y, h = map(int, input().split())
    print(x, y, h)
    exit()
for _ in range(n):
    s = [list(map(int, input().split())) for _ in range(n)]
    for i in range(101):
        for j in range(101):
            h = -1
            ok = 1
            for t in s:
                if h == -1:
                    h = abs(t[0] - i) + abs(t[1] - j) + t[2]
                else:
                    h0 = abs(t[0] - i) + abs(t[1] - j) + t[2]
                    if h == h0:
                        ok += 1
            if ok == n:
                print(i, j, h)
                exit()

Fixed submission:
n = int(input())
if n == 1:
    x, y, h = map(int, input().split())
    print(x, y, h)
    exit()
s = [list(map(int, input().split())) for _ in range(n)]
for i in range(101):
    for j in range(101):
        h = -1
        ok = 1
        for t in s:
            if t[2] == 0:
                ok += 1
            elif h == -1:
                h = abs(t[0] - i) + abs(t[1] - j) + t[2]
            else:
                h0 = abs(t[0] - i) + abs(t[1] - j) + t[2]
                if h == h0:
                    ok += 1
        if ok == n:
            for t in s:
                if abs(t[0] - i) + abs(t[1] - j) <= h:
                    if not h == abs(t[0] - i) + abs(t[1] - j) + t[2]:
                        ok = 0
                else:
                    if not t[2] == 0:
                        ok = 0
            if ok == n:
                print(i, j, h)
                exit()

Buggy python submission (verdict: Runtime Error):
n = int(input())
s = [list(map(int, input().split())) for _ in range(n)]
if not n == 1:
    for i in range(101):
        for j in range(101):
            c = s[0][2] + abs(i - s[0][0]) + abs(j - s[0][1])
            d = 0
            for k in range(1, n):
                if not abs(i - s[k][0]) + abs(j - s[k][1]) == c - s[k][2]:
                    d = 1
                    break
            if d == 0:
                ans = [i, j, c]
                break
else:
    ans = s[0]
print(" ".join(map(str, ans)))

Fixed submission:
n = int(input())
if n == 1:
    x, y, h = map(int, input().split())
    print(x, y, h)
    exit()
s = [list(map(int, input().split())) for _ in range(n)]
for i in range(101):
    for j in range(101):
        h = -1
        ok = 1
        for t in s:
            if t[2] == 0:
                ok += 1
            elif h == -1:
                h = abs(t[0] - i) + abs(t[1] - j) + t[2]
            else:
                h0 = abs(t[0] - i) + abs(t[1] - j) + t[2]
                if h == h0:
                    ok += 1
        if ok == n:
            for t in s:
                if abs(t[0] - i) + abs(t[1] - j) <= h:
                    if not h == abs(t[0] - i) + abs(t[1] - j) + t[2]:
                        ok = 0
                else:
                    if not t[2] == 0:
                        ok = 0
            if ok == n:
                print(i, j, h)
                exit()