Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
counter = 0
while(True):
  for i in range(n):
    if a[i] % 2 != 0:
      break
    else:
      a[i] = a[i] // 2
  counter += 1
print(counter)

Fixed submission:
from fractions import gcd
n = int(input())
a = list(map(int, input().split()))
g = a[0]
for i in range(n):
  g = gcd(g, a[i])
counter = 0
while(True):
  if g % 2 != 0:
    break
  else:
    counter += 1
    g = g // 2
print(counter)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = map(int, input().split())
counter = 0
while(True):
  for i in range(n):
    if a[i] % 2 != 0:
      break
    else:
      a[i] = a[i] // 2
  counter += 1
print(counter)

Fixed submission:
from fractions import gcd
n = int(input())
a = list(map(int, input().split()))
g = a[0]
for i in range(n):
  g = gcd(g, a[i])
counter = 0
while(True):
  if g % 2 != 0:
    break
  else:
    counter += 1
    g = g // 2
print(counter)
Buggy python submission (verdict: Runtime Error):
n, a, b = map(int, inpit().split())

print(min(n * a, b))

Fixed submission:
n, a, b = map(int, input().split())

print(min(n * a, b))
Buggy python submission (verdict: Runtime Error):
 N = input()

 answer = ""

 for i in range(1 << 3):
     exp = N[0]
     for j in range(3):
         if i >> j & 1:
             exp += "+"
         else:
             exp += "-"
         exp += N[j + 1]
     if eval(exp) == 7:
         answer = exp
         break

 print(answer + "=7")


Fixed submission:
N = input()

answer = ""

for i in range(1 << 3):
    exp = N[0]
    for j in range(3):
        if i >> j & 1:
            exp += "+"
        else:
            exp += "-"
        exp += N[j + 1]
    if eval(exp) == 7:
        answer = exp
        break

print(answer + "=7")

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

 for i in range(1 << 3):
     exp = N[0]
     for j in range(3):
         if i >> j & 1:
             exp += "+"
         else:
             exp += "-"
         exp += N[j + 1]
     if eval(exp) == 7:
         print(exp + "=7")
         break





Fixed submission:
N = input()

answer = ""

for i in range(1 << 3):
    exp = N[0]
    for j in range(3):
        if i >> j & 1:
            exp += "+"
        else:
            exp += "-"
        exp += N[j + 1]
    if eval(exp) == 7:
        answer = exp
        break

print(answer + "=7")
Buggy python submission (verdict: Runtime Error):
x, y = input().split()

print(max(int(x), int(y)))

Fixed submission:
x, y = input().split()

if (ord(x) > ord(y)):
  print('>')
elif (ord(x) < ord(y)):
  print('<')
else:
  print('=')
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
p = 0
for i in range(x):
  if (b + c) * i + c <= a:
    p = i
  else:
    break
print(p)

Fixed submission:
a, b, c = map(int, input().split())
p = 0
for i in range(a):
  if (b + c) * i + c <= a:
    p = i
  else:
    break
print(p)
Buggy python submission (verdict: Runtime Error):
r, g = map(int, input().split())

print(r + (g-r) * 2)

Fixed submission:
r = int(input())
g = int(input())

print(r + (g-r) * 2)
Buggy python submission (verdict: Runtime Error):
S = []
for _ in range(h):
  S.append(input())

for i in range(h):
  ss = ''
  for j in range(w):
    if S[i][j] == '#':
      ss += '#'
    else:
      counter = 0
      for k in [-1, 0, 1]:
        for l in [-1, 0, 1]:
          if 0 <= i+k <= h-1 and 0 <= j+l <= w-1 and S[i+k][j+l] == '#':
            counter += 1
      ss += str(counter)
  print(ss)

Fixed submission:
h, w = map(int, input().split())

S = []
for _ in range(h):
  S.append(input())

for i in range(h):
  ss = ''
  for j in range(w):
    if S[i][j] == '#':
      ss += '#'
    else:
      counter = 0
      for k in [-1, 0, 1]:
        for l in [-1, 0, 1]:
          if 0 <= i+k <= h-1 and 0 <= j+l <= w-1 and S[i+k][j+l] == '#':
            counter += 1
      ss += str(counter)
  print(ss)
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
import sys, itertools


def solve(N: int, K: int, x: "List[int]", y: "List[int]"):
    mn = 1e25
    for X in itertools.combinations(x, 2):
        for Y in itertools.combinations(y, 2):
            if len([xx for (xx, yy) in zip(x, y) if (X[0]-xx)*(X[1]-xx)<=0 and (Y[0]-yy)*(Y[1]-yy)<=0]) >= K:
                mn = min(mn, abs(X[0] - X[1]) * abs(Y[0] - Y[1]))
    print(mn)
    return


# Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    x = [int()] * (N)  # type: "List[int]"
    y = [int()] * (N)  # type: "List[int]"
    for i in range(N):
        x[i] = int(next(tokens))
        y[i] = int(next(tokens))
    solve(N, K, x, y)

if __name__ == '__main__':
    main()


Fixed submission:
#!/usr/bin/env python3
import sys, itertools


def solve(N: int, K: int, x: "List[int]", y: "List[int]"):
    mn = 1e25
    for X in itertools.combinations(x, 2):
        for Y in itertools.combinations(y, 2):
            if len([xx for (xx, yy) in zip(x, y) if (X[0]-xx)*(X[1]-xx)<=0 and (Y[0]-yy)*(Y[1]-yy)<=0]) >= K:
                mn = min(mn, abs(X[0] - X[1]) * abs(Y[0] - Y[1]))
    print(mn)
    return


# Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    x = [int()] * (N)  # type: "List[int]"
    y = [int()] * (N)  # type: "List[int]"
    for i in range(N):
        x[i] = int(next(tokens))
        y[i] = int(next(tokens))
    solve(N, K, x, y)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
s = input()
s = [ord(ss) in ss in s]
flag = False
for i in range(ord('a'), ord('z')+1):
  if i in s:
    flag = True
    ans = chr(i)
if flag:
  print(ans)
else:
  print('None')
  

Fixed submission:
s = input()
s = [ord(ss) for ss in s]
flag = []
for i in range(ord('a'), ord('z')+1):
  if i in s:
    flag.append(i)
if len(set(flag)) == 26:
  print('None')
else:
  for i in range(ord('a'), ord('z')+1):
    if i not in flag:
      print(chr(i))
      break
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())

print((n-1)(m-1))

Fixed submission:
n, m = map(int, input().split())

print((n-1) * (m-1))
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
import sys, math, fractions, itertools

YES = "POSSIBLE"  # type: str
NO = "IMPOSSIBLE"  # type: str

def solve(N: int, M: int, a: "List[int]", b: "List[int]"):
    G = [[] for _ in range(N)]
    for i in range(M):
        G[a[i]-1].append(b[i]-1)
        G[b[i]-1].append(a[i]-1)
    flag = False
    for g in G[0]:
        if g in G[-1]:
            flag = True
    if flag:
        print('POSSIBLE')
    else:
        print('IMPOSSIBLE')
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    a = [int()] * (M)  # type: "List[int]" 
    b = [int()] * (M)  # type: "List[int]" 
    for i in range(M):
        a[i] = int(next(tokens))
        b[i] = int(next(tokens))
    solve(N, M, a, b)

if __name__ == '__main__':
    main()


Fixed submission:
#!/usr/bin/env python3
import sys, math, fractions, itertools, bisect

YES = "POSSIBLE"  # type: str
NO = "IMPOSSIBLE"  # type: str

def solve(N: int, M: int, a: "List[int]", b: "List[int]"):
    G = [[] for _ in range(N)]
    for i in range(M):
        G[a[i]-1].append(b[i]-1)
        G[b[i]-1].append(a[i]-1)
    G[0].sort()
    G[-1].sort()
    flag = False
    for g in G[0]:
        i = bisect.bisect_left(G[-1], g)
        if 0 <= i <= len(G[-1])-1:
            if G[-1][i] == g:
                flag = True
    if flag:
        print('POSSIBLE')
    else:
        print('IMPOSSIBLE')
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    a = [int()] * (M)  # type: "List[int]" 
    b = [int()] * (M)  # type: "List[int]" 
    for i in range(M):
        a[i] = int(next(tokens))
        b[i] = int(next(tokens))
    solve(N, M, a, b)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split())

if a <= c and c <= b:
  print("Yes")
eles:
  print('No')

Fixed submission:
a, b, c = map(int, input().split())

if a <= c and c <= b:
  print("Yes")
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
A, B = map(int. input().split())

print((A + B) % 24)

Fixed submission:
A, B = map(int, input().split())

print((A + B) % 24)
Buggy python submission (verdict: Runtime Error):
s = input()

if s in ['a', 'i', 'u', 'e'. 'o']:
  print('vowel')
else:
  print('consonant')

Fixed submission:
s = input()

if s in ['a', 'i', 'u', 'e', 'o']:
  print('vowel')
else:
  print('consonant')
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
import sys, math, fractions, itertools


def solve(N: int, T: "List[int]", A: "List[int]"):
    tmpT = T[0]
    tmpA = A[0]
    for i in range(1, N):
        d = 1
        while(T[i]*d<tmpT or A[i]*d<tmpA):
            d += 1
        tmpT = T[i] * d
        tmpA = A[i] * d
    print(tmpT+tmpA)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    T = [int()] * (N)  # type: "List[int]" 
    A = [int()] * (N)  # type: "List[int]" 
    for i in range(N):
        T[i] = int(next(tokens))
        A[i] = int(next(tokens))
    solve(N, T, A)

if __name__ == '__main__':
    main()


Fixed submission:
#!/usr/bin/env python3
import sys, math, fractions, itertools


def solve(N: int, T: "List[int]", A: "List[int]"):
    tmpT = 1
    tmpA = 1
    for i in range(N):
        d = max((tmpT-1)//T[i]+1, (tmpA-1)//A[i]+1)
        tmpT = T[i] * d
        tmpA = A[i] * d
    print(tmpT+tmpA)
    return

def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    T = [int()] * (N)  # type: "List[int]" 
    A = [int()] * (N)  # type: "List[int]" 
    for i in range(N):
        T[i] = int(next(tokens))
        A[i] = int(next(tokens))
    solve(N, T, A)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys, math, fractions, itertools

def solve(N: int, A: int, x: "List[int]"):
    X = max(x)
    dp = [[[0 for _ in range(max(N*X+1, N*A+1))] for _ in range(N+1) ] for _ in range(N+1)]
    dp[0][0][0] = 1
    for n in range(N+1):
        for m in range(N+1):
            for k in range(N*X+1):
                if n >= 1 and k < x[n-1]:
                    dp[n][m][k] = dp[n-1][m][k]
                elif n >= 1 and m >= 1 and k >= x[n-1]:
                    dp[n][m][k] = dp[n-1][m][k] + dp[n-1][m-1][k-x[n-1]]
    s = 0
    for i in range(1, N+1):
        s += dp[N][i][i*A]
    print(s)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = int(next(tokens))  # type: int
    x = [ int(next(tokens)) for _ in range(N) ]  # type: "List[int]"
    solve(N, A, x)

if __name__ == '__main__':
    main()


Fixed submission:
n = int(input())
k = int(input())
x = int(input())
y = int(input())

if n <= k:
  print(n * x)
else:
  print(k * x + (n-k) * y)
Buggy python submission (verdict: Runtime Error):
S = input()

N = S.count('N')
S = S.count('S')
E = S.count('E')
W = S.count('W')

if N == S and E == W:
  print('Yes')
else:
  print('No')

Fixed submission:
#!/usr/bin/env python3
import sys, math, fractions, itertools, collections, copy, heapq

YES = "Yes"  # type: str
NO = "No"  # type: str

def solve(s: str):
    N = s.count('N')
    S = s.count('S')
    E = s.count('E')
    W = s.count('W')
    if (N == 0 and S != 0) or (N != 0 and S == 0) or (E == 0 and W != 0) or (E != 0 and W == 0):
        print('No')
    else:
        print('Yes')
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    solve(S)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
a = [int(x)-1 for x in input().split()]

visited = [0] * n
visited[0] = 1
visit_list = [0]
visit = 0
while True:
    new_visit = a[visit]
    if visited[new_visit] == 1:
        break
    visited[new_visit] = 1
    visit_list.append(new_visit)
    visit = new_visit

period_first_index = visit_list.index(a[visit_list[-1]])
period_list = visit_list[period_first_index:]
period = len(visit_list) - period_first_index

if k <= len(visit_list):
    print(visit_list[k]+1)
else:
    print(period_list[(k-period_first_index)%period]+1)

Fixed submission:
n, k = map(int, input().split())
a = [int(x)-1 for x in input().split()]

visited = [0] * n
visited[0] = 1
visit_list = [0]
visit = 0
while True:
    new_visit = a[visit]
    if visited[new_visit] == 1:
        break
    visited[new_visit] = 1
    visit_list.append(new_visit)
    visit = new_visit

period_first_index = visit_list.index(a[visit_list[-1]])
period_list = visit_list[period_first_index:]

if k < len(visit_list):
    print(visit_list[k]+1)
elif k == len(visit_list):
    print(a[visit_list[-1]]+1)
else:
    print(period_list[(k-period_first_index)%len(period_list)]+1)
Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
a = list(map(int, input().split()))

for i in range(m):
    max_a = max(a)
    a.append(max_a / 2)
    a.remove(max_a)

res_list = [int(_) for _ in a]
print(sum(res_list))

Fixed submission:
import heapq

n, m = map(int, input().split())
a = [-int(_) for _ in input().split()]

heapq.heapify(a)

for i in range(m):
    tmp = heapq.heappop(a)
    a.append(tmp / 2)

res_list = [int(-_) for _ in a]
print(sum(res_list))
Buggy python submission (verdict: Runtime Error):
n = int(input())
print(int(n(n-1)/2))

Fixed submission:
n = int(input())
print(n*(n-1)//2)
Buggy python submission (verdict: Runtime Error):
n = int(input())
ss = []
for i in range(n):
    s = input()
    ss.append(''.join(sorted(s)))

ss = sorted(ss)

res = 0
while True:
    if len(ss) == 0:
        break
    if ss[0] != ss[1]:
        ss.pop(0)
        continue
    i = 1
    while True:
        if i == len(ss):
            res += i * (i-1) / 2
            for num in range(i):
                ss.pop(0)
            break
        if ss[0] == ss[i]:
            i += 1
        else:
            res += i * (i-1) / 2
            for num in range(i):
                ss.pop(0)
            break

print(int(res))

Fixed submission:
n = int(input())
ss = []
for i in range(n):
    s = input()
    ss.append(''.join(sorted(s)))

ss = sorted(ss)

res = 0
while True:
    if len(ss) <= 1:
        break
    if ss[0] != ss[1]:
        ss.pop(0)
        continue
    i = 1
    while True:
        if i == len(ss):
            res += i * (i-1) / 2
            for num in range(i):
                ss.pop(0)
            break
        if ss[0] == ss[i]:
            i += 1
        else:
            res += i * (i-1) / 2
            for num in range(i):
                ss.pop(0)
            break

print(int(res))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ss = []
for i in range(n):
    s = input()
    ss.append(''.join(sorted(s)))

ss = sorted(ss)

res = 0
for i in range(len(ss)-1):
    for j in range(i+1, len(ss)):
        if ss[i] == ss[j]:
            res += 1
        else:
            break

print(res)

Fixed submission:
n = int(input())
ss = []
for i in range(n):
    s = input()
    ss.append(''.join(sorted(s)))

ss = sorted(ss)

res = 0
while True:
    if len(ss) <= 1:
        break
    if ss[0] != ss[1]:
        ss.pop(0)
        continue
    i = 1
    while True:
        if i == len(ss):
            res += i * (i-1) / 2
            for num in range(i):
                ss.pop(0)
            break
        if ss[0] == ss[i]:
            i += 1
        else:
            res += i * (i-1) / 2
            for num in range(i):
                ss.pop(0)
            break

print(int(res))
Buggy python submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))

i = 0
while True:
    if i == n-1:
        print('Yes')
        break
    if h[i] <= h[i+1]:
        print(i, 'a', h)
        if i == 0 or h[i-1] < h[i]:
            h[i] -= 1
        i += 1
    elif h[i] == h[i+1]+1 and (i==0 or h[i-1] < h[i]):
        print(i, 'b', h)
        h[i] -= 1
        i += 1
    else:
        print('No')
        break

Fixed submission:
n = int(input())
h = list(map(int, input().split()))

i = 0

while True:
    if i == n-1:
        print('Yes')
        break
    if h[i] <= h[i+1]:
        if i == 0 or h[i-1] < h[i]:
            h[i] -= 1
        i += 1
    elif h[i] == h[i+1]+1 and (i==0 or h[i-1] < h[i]):
        h[i] -= 1
        i += 1
    else:
        print('No')
        break
Buggy python submission (verdict: Time Limit Exceeded):
import copy

n = int(input())
a = []
for i in range(n):
    a.append(int(input()))

for i in range(n):
    b = copy.deepcopy(a)
    b.pop(i)
    print(max(b))

Fixed submission:
import copy

n = int(input())
a = []
for i in range(n):
    a.append(int(input()))

m_1 = sorted(a)[-1]
m_2 = sorted(a)[-2]

for i in range(n):
    if a[i] == m_1:
        print(m_2)
    else:
        print(m_1)
Buggy python submission (verdict: Runtime Error):
l, r = map(int, input().split())

if l%2019 >= r%2019:
    print(0)
elif l%2019 == 0 or r%2019 == 0:
    print(0)
else:
    h = []
    for i in range(1, (r-l)%2019):
        h.append((l%2019)*((l+i)%2019)%2019)
    print(min(h))

Fixed submission:
l, r = map(int, input().split())

if l%2019 >= r%2019:
    print(0)
elif r-l >= 2019:
    print(0)
elif l%2019 == 0 or r%2019 == 0:
    print(0)
else:
    h = []
    for i in range((r-l)%2019):
        for j in range(i+1, (r-l+1)%2019):
            h.append((((l+i)%2019)*((l+j)%2019))%2019)
    print(min(h))
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = []
for i in range(m):
    a.append(int(input()))

flag = 0
for i in range(m-1):
    if a[i+1] - a[i] == 0:
        flag = 1
        print(0)
        break

if flag == 0:
    b = [1]
    if a[0] == 1:
        b.append(0)
        a.pop(0)
    else:
        b.append(1)
    for i in range(2, n+1):
        if len(a) != 0 and a[0] == i:
            b.append(0)
            a.pop(0)
        else:
            b.append((b[i-1]+b[i-2])%1000000007)

    print(b[-1])

Fixed submission:
n, m = map(int, input().split())
a = []
for i in range(m):
    a.append(int(input()))

flag = 0
for i in range(m-1):
    if a[i+1] - a[i] == 0:
        flag = 1
        print(0)
        break

if flag == 0:
    b = [1]
    if len(a) != 0 and a[0] == 1:
        b.append(0)
        a.pop(0)
    else:
        b.append(1)
    for i in range(2, n+1):
        if len(a) != 0 and a[0] == i:
            b.append(0)
            a.pop(0)
        else:
            b.append((b[i-1]+b[i-2])%1000000007)

    print(b[-1])

Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = []
for i in range(m):
    a.append(int(input()))

flag = 0
for i in range(m-1):
    if a[i+1] - a[i] == 0:
        flag = 1
        print(0)
        break

if flag == 0:
    b = [1]
    if a[0] == 1:
        b.append(0)
        a.pop(0)
    else:
        b.append(1)
    for i in range(2, n+1):
        if len(a) != 0 and a[0] == i:
            b.append(0)
            a.pop(0)
        else:
            b.append((b[i-1]+b[i-2])%1000000007)

print(b[-1])

Fixed submission:
n, m = map(int, input().split())
a = []
for i in range(m):
    a.append(int(input()))

flag = 0
for i in range(m-1):
    if a[i+1] - a[i] == 0:
        flag = 1
        print(0)
        break

if flag == 0:
    b = [1]
    if len(a) != 0 and a[0] == 1:
        b.append(0)
        a.pop(0)
    else:
        b.append(1)
    for i in range(2, n+1):
        if len(a) != 0 and a[0] == i:
            b.append(0)
            a.pop(0)
        else:
            b.append((b[i-1]+b[i-2])%1000000007)

    print(b[-1])
Buggy python submission (verdict: Time Limit Exceeded):
n, q = map(int, input().split())
s = input()

for i in range(q):
    li, ri = map(int, input().split())
    tmp = s[li-1:ri]
    count = 0
    for j in range(len(tmp)-1):
        if tmp[j] == 'A' and tmp[j+1] == 'C':
            count += 1
    print(count)

Fixed submission:
n, q = map(int, input().split())
s = input()

l = []
r = []
for i in range(q):
    li, ri = map(int, input().split())
    l.append(li)
    r.append(ri)

acs = [0]
count = 0
idx = 1
while True:
    if idx == n:
        break
    if s[idx-1] == 'A' and s[idx] == 'C':
        count += 1
    acs.append(count)
    idx += 1

for i in range(q):
    print(acs[r[i]-1] - acs[l[i]-1])
Buggy python submission (verdict: Runtime Error):
n = int(input())
x = []
y = []
h = []
for i in range(n):
    xi, yi, hi = [int(_) for _ in input().split()]
    if hi != 0:
        x.append(xi)
        y.append(yi)
        h.append(hi)

for cxi in range(101):
    for cyi in range(101):
        flag = True
        for i in range(n):
            if i == 0:
                height = h[i] + abs(x[i]-cxi) + abs(y[i]-cyi)
            else:
                if height != h[i] + abs(x[i]-cxi) + abs(y[i]-cyi):
                    flag = False
                    continue
        if flag:
            print(cxi, cyi, height)

Fixed submission:
n = int(input())
x = []
y = []
h = []
ot = []
for i in range(n):
    xi, yi, hi = [int(_) for _ in input().split()]
    if hi != 0:
        x.append(xi)
        y.append(yi)
        h.append(hi)
    else:
        ot.append([xi, yi, hi])

ans = []
for cxi in range(101):
    for cyi in range(101):
        flag = True
        for i in range(len(h)):
            if i == 0:
                height = h[i] + abs(x[i]-cxi) + abs(y[i]-cyi)
            else:
                if height != h[i] + abs(x[i]-cxi) + abs(y[i]-cyi):
                    flag = False
                    continue
        if flag:
            ans.append([cxi, cyi, height])

if len(ans) == 1:
    print(ans[0][0], ans[0][1], ans[0][2])
else:
    for a in ans:
        flag = True
        for o in ot:
            if max((a[2] - abs(o[0]-a[0]) - abs(o[1]-a[1])), 0) != o[2]:
                flag = False
                continue
        if flag:
            print(a[0], a[1], a[2])