Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
a = input()
if a >=30:
  print("Yes")
else:
  print("No")

Fixed submission:
a = int(input())
if a >=30:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
a = list(map(int,input().split()))
print(aa.index(0))

Fixed submission:
a = list(map(int,input().split()))
print(a.index(0) + 1)
Buggy python submission (verdict: Runtime Error):
a = input()
b = 0
while a >= 500:
  a-=500
  b+=1000
while a >= 5:
  a-=5
  b+=5
print(b)

Fixed submission:
a = int(input())
b = 0
while a >= 500:
  a-=500
  b+=1000
while a >= 5:
  a-=5
  b+=5
print(b)
Buggy python submission (verdict: Runtime Error):
a = input()
b = 0
while a >= 0:
	a -= 2
    b += 1
    if a == 1:
      break
else:
	print(b)
print(b + 1)


Fixed submission:
a = int(input())
b = 0
while a > 0:
  a -= 2
  b += 1
  if a == 1:
    print(b + 1)
    break
else:
  print(b)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
c = 0
while a > 0:
  a -= b
  c += 1
print(c

Fixed submission:
a, b = map(int, input().split())
c = 0
while a > 0:
  a -= b
  c += 1
print(c)
Buggy python submission (verdict: Runtime Error):
a, b = input().split
if a == b:
  print("Yes")
else:
  print("No")

Fixed submission:
a, b = input().split()
if a == b:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
a, b = input().split
if a == b:
  print("Yes")
else:
  print("No")

Fixed submission:
a, b = input().split()
if a == b:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
a, b = input().split
if a > b:
  print("No")
else:
  print("Yes")

Fixed submission:
a, b = input().split()
if a == b:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
a, b = input().split()

if 500*a >= b:
  print("Yes")
else:
  primt("No")

Fixed submission:
a = list(map(int,input().split()))
 
if 500*a[0] >= a[1]:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
a = str(input())
b = str(input())
c = (b + a)
print(c)

Fixed submission:
a, b = input(). split()
c = (b + a)
print(c)

Buggy python submission (verdict: Runtime Error):
a = str(input())
b = str(input())
print(a + b)

Fixed submission:
a, b = input(). split()
c = (b + a)
print(c)

Buggy python submission (verdict: Runtime Error):
print(str(input()) + str(input()))

Fixed submission:
a, b = input(). split()
c = (b + a)
print(c)
Buggy python submission (verdict: Runtime Error):
a, b = input().split()
a = int(a)
b = list(map(int, input().split('.')))
b = b[0]*100+b[1]
ans = str(a*b)
print(ans[:-2])

Fixed submission:
a, b = input().split()
a = int(a)
b = list(map(int, b.split('.')))
b = b[0]*100+b[1]
ans = a*b
if ans<100:
  print(0)
else:
  print(str(ans)[:-2])

Buggy python submission (verdict: Runtime Error):
s = input().split()
a = int(s[0])
b = int(s[1]replace(, '.', ''))
ans = floor(a*b/100)
print(ans)

Fixed submission:
a, b = input().split()
a = int(a)
b = list(map(int, b.split('.')))
b = b[0]*100+b[1]
ans = a*b
if ans<100:
  print(0)
else:
  print(str(ans)[:-2])
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
ac = [0 for _ in range(n)]
pen = [0 for _ in range(n)]

for _ in range(m):
  p, s = input().split()
  p = int(p) - 1
  if s == 'WA':
    if ac[p] == 0:
      pen[p] += 1
  else:
    ac[p] = 1

for p in range(m):
  if ac[p] == 0:
    pen[p] = 0
print(str(sum(ac)) + ' ' + str(sum(pen)))

Fixed submission:
n, m = map(int, input().split())
ac = [0 for _ in range(n)]
pen = [0 for _ in range(n)]

for _ in range(m):
  p, s = input().split()
  p = int(p) - 1
  if s == 'WA':
    if ac[p] == 0:
      pen[p] += 1
  else:
    ac[p] = 1

for p in range(n):
  if ac[p] == 0:
    pen[p] = 0
print(str(sum(ac)) + ' ' + str(sum(pen)))
Buggy python submission (verdict: Runtime Error):
s = input()
print(s.replace(' ', '')

Fixed submission:
s, t = input().split()
print(t + s)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = input()

kset = []
cnt = 0
for i in range(n-2):
  for j in range(i+1, n-1):
    k2 = s[i] + s[j]
    if k2 not in kset:
      kset.append(k2)
      k3 = set(list(s[j+1:]))
      cnt += len(k3)

print(cnt)



Fixed submission:
n = int(input())
s = input()

cnt = 0
for i in range(10):
  k1 = s.find(str(i))
  if k1 == -1:
    continue
  for j in range(10):
    k2 = s[k1+1:].find(str(j))
    if k2 == -1:
      continue

    k3 = set(list(s[k1+k2+2:]))
    cnt += len(k3)

print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
# n = int(input())
# a, b = map(int, input().split())
# an = list(map(int, input().split()))

n = int(input())
ln = list(map(int, input().split()))

ln.sort(reverse=True)

bcs = []
for i in range(1, n-1):
  row = []
  for j in range(i+1, n):
    row.append(ln[i] + ln[j])
  bcs.append(row)

cnt = 0
ix = [0 for _ in range(n-2)]
# a > b,c
for i in range(n-2):
  a = ln[i]
  for j in range(i, n-2):
    try:
      while ix[j] < (n - 2 - j) and bcs[j][ ix[j] ] > a:
        ix[j] += 1
    except:
      print(j, ix[j])
      exit()
  cnt += sum(ix[i:])
print(cnt)

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

ln.sort(reverse=True)

bcs = []
for i in range(1, n-1):
  row = []
  for j in range(i+1, n):
    row.append(ln[i] + ln[j])
  bcs.append(row)

cnt = 0
ix = [0 for _ in range(n-2)]
# a > b,c
for i in range(n-2):
  a = ln[i]
  for j in range(i, n-2):
    try:
      while ix[j] < (n - 2 - j) and bcs[j][ ix[j] ] > a:
        ix[j] += 1
    except:
      print(j, ix[j])
      exit()
  cnt += sum(ix[i:])
print(cnt)
Buggy python submission (verdict: Runtime Error):
k, x = map(int, input())
rng = range(x-k+1, x+k)
print(' '.join(map(str, rng)))

Fixed submission:
k, x = map(int, input().split())
rng = range(x-k+1, x+k)
print(' '.join(map(str, rng)))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
an = []
for _ in range(n):
  an.append(int(input()))
maxl = [an[0]]
maxr = [an[-1]]
for a in an[1:]:
  maxl.append(max(maxl[-1], a))
for a in an[:-1][::-1]:
  maxr.insert(0, max(maxr[0], a))

print(maxr[1])
for i in range(1, n-1):
  print(max(maxl[i-1], maxr[i+1]))
print(maxl[n-2])

Fixed submission:
n = int(input())
an = []
for _ in range(n):
  an.append(int(input()))
maxl = [an[0]]
maxr = [an[-1]]
for a in an[1:]:
  maxl.append(max(maxl[-1], a))
for a in an[:-1][::-1]:
  maxr.append(max(maxr[-1], a))
maxr = maxr[::-1]

print(maxr[1])
for i in range(1, n-1):
  print(max(maxl[i-1], maxr[i+1]))
print(maxl[n-2])

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
an = []
for _ in range(n):
  an.append(int(input()))
maxl = [an[0]]
maxr = [an[-1]]
for a in an[1:]:
  maxl.append(max(maxl[-1], a))
for a in an[-2::-1]:
  maxr.insert(0, max(maxr[0], a))

print(maxr[1])
for i in range(1, n-1):
  print(max(maxl[i-1], maxr[i+1]))
print(maxl[n-2])

Fixed submission:
n = int(input())
an = []
for _ in range(n):
  an.append(int(input()))
maxl = [an[0]]
maxr = [an[-1]]
for a in an[1:]:
  maxl.append(max(maxl[-1], a))
for a in an[:-1][::-1]:
  maxr.append(max(maxr[-1], a))
maxr = maxr[::-1]

print(maxr[1])
for i in range(1, n-1):
  print(max(maxl[i-1], maxr[i+1]))
print(maxl[n-2])

Buggy python submission (verdict: Runtime Error):
n = int(input())
an = []
for _ in range(n):
  an.append(int(input()))
maxl = [an[0]]
maxr = [an[-1]]
for a in an[1:]:
  maxl.append(max(maxl[-1], a))
for a in an[1::-1]:
  maxr.insert(0, max(maxr[0], a))

print(maxr[1])
for i in range(1, n-1):
  print(max(maxl[i-1], maxr[i+1]))
print(maxl[n-2])

Fixed submission:
n = int(input())
an = []
for _ in range(n):
  an.append(int(input()))
maxl = [an[0]]
maxr = [an[-1]]
for a in an[1:]:
  maxl.append(max(maxl[-1], a))
for a in an[:-1][::-1]:
  maxr.append(max(maxr[-1], a))
maxr = maxr[::-1]

print(maxr[1])
for i in range(1, n-1):
  print(max(maxl[i-1], maxr[i+1]))
print(maxl[n-2])

Buggy python submission (verdict: Runtime Error):
n = int(input())
an = []
for _ in n:
  an.append(int(input()))
maxl = [an[0]]
maxr = [an[-1]]
for a in an[1:]:
  maxl.append(max(maxl[-1], a))
for a in an[:-2:-1]:
  maxr.insert(0, max(maxr[0], a))

print(maxr[1])
for i in range(1, n-1):
  print(max(maxl[i-1], maxr[i+1]))
print(maxl[n-2])

Fixed submission:
n = int(input())
an = []
for _ in range(n):
  an.append(int(input()))
maxl = [an[0]]
maxr = [an[-1]]
for a in an[1:]:
  maxl.append(max(maxl[-1], a))
for a in an[:-1][::-1]:
  maxr.append(max(maxr[-1], a))
maxr = maxr[::-1]

print(maxr[1])
for i in range(1, n-1):
  print(max(maxl[i-1], maxr[i+1]))
print(maxl[n-2])
Buggy python submission (verdict: Runtime Error):
n, a, b = map(int, input().spalit())
pa = n * a
print(min(pa, b))

Fixed submission:
n, a, b = map(int, input().split())
pa = n * a
print(min(pa, b))
Buggy python submission (verdict: Runtime Error):
n = int(input())
if n = 1:
  print(1)
  exit()
xy = []
for _ in range(n):
  x, y = map(int, input().split())
  xy.append([x, y])

vecs = {}
for i in range(n):
  for j in range(i+1, n):
    if xy[i][0] < xy[j][0]:
      vec = (xy[j][0] - xy[i][0], xy[j][1] - xy[i][1])
    elif xy[i][0] > xy[j][0]:
      vec = (xy[i][0] - xy[j][0], xy[i][1] - xy[j][1])
    else:
      vec = (0, abs(xy[j][1] - xy[i][1]))
    
    if vec in vecs:
      vecs[vec] += 1
    else:
      vecs[vec] = 1

vec_max = max(list(vecs.values()))
print(n - vec_max)
    

Fixed submission:
n = int(input())
if n == 1:
  print(1)
  exit()
xy = []
for _ in range(n):
  x, y = map(int, input().split())
  xy.append([x, y])

vecs = {}
for i in range(n):
  for j in range(i+1, n):
    if xy[i][0] < xy[j][0]:
      vec = (xy[j][0] - xy[i][0], xy[j][1] - xy[i][1])
    elif xy[i][0] > xy[j][0]:
      vec = (xy[i][0] - xy[j][0], xy[i][1] - xy[j][1])
    else:
      vec = (0, abs(xy[j][1] - xy[i][1]))
    
    if vec in vecs:
      vecs[vec] += 1
    else:
      vecs[vec] = 1

vec_max = max(list(vecs.values()))
print(n - vec_max)

Buggy python submission (verdict: Runtime Error):
n = int(input())
xy = []
for _ in range(n):
  x, y = map(int, input().split())
  xy.append([x, y])

vecs = {}
for i in range(n):
  for j in range(i+1, n):
    if xy[i][0] < xy[j][0]:
      vec = (xy[j][0] - xy[i][0], xy[j][1] - xy[i][1])
    elif xy[i][0] > xy[j][0]:
      vec = (xy[i][0] - xy[j][0], xy[i][1] - xy[j][1])
    else:
      vec = (0, abs(xy[j][1] - xy[i][1]))
    
    if vec in vecs:
      vecs[vec] += 1
    else:
      vecs[vec] = 1

vec_max = max(list(vecs.values()))
print(n - vec_max)
    

Fixed submission:
n = int(input())
if n == 1:
  print(1)
  exit()
xy = []
for _ in range(n):
  x, y = map(int, input().split())
  xy.append([x, y])

vecs = {}
for i in range(n):
  for j in range(i+1, n):
    if xy[i][0] < xy[j][0]:
      vec = (xy[j][0] - xy[i][0], xy[j][1] - xy[i][1])
    elif xy[i][0] > xy[j][0]:
      vec = (xy[i][0] - xy[j][0], xy[i][1] - xy[j][1])
    else:
      vec = (0, abs(xy[j][1] - xy[i][1]))
    
    if vec in vecs:
      vecs[vec] += 1
    else:
      vecs[vec] = 1

vec_max = max(list(vecs.values()))
print(n - vec_max)
Buggy python submission (verdict: Time Limit Exceeded):
s = input()

times = 0
while 'ABC' in s:
  times += 1
  s = s.replace('ABC', 'BCA', 1)
print(times)


Fixed submission:
import re

s = input()
s = s.replace('BC', 'D')
ss = [c for c in re.split('[BC]', s) if c != '']

sum = 0
for s in ss:
  na = 0
  for c in s:
    if c == 'A':
      na += 1
    else:
      sum += na

print(sum)
Buggy python submission (verdict: Runtime Error):
n,m = map(int, input().split())
lmax,rmin=0,n+1
for i in range(m):
  l,r=map(int, input().split()
  lmax=max(l,lmax)
  rmin=min(r,rmin)
print(max(0,lmax-rmin+1))

Fixed submission:
n,m = map(int, input().split())
lmax,rmin=0,n+1
for i in range(m):
  l,r=map(int, input().split())
  lmax=max(l,lmax)
  rmin=min(r,rmin)
print(max(0,rmin-lmax+1))

Buggy python submission (verdict: Runtime Error):
n,m = map(int, input().split())
lmax,rmin=0,n+1
for i in range(m):
  l,r=map(int, input().split()
  lmax=max(l,lmax)
  rmin=min(r,rmin)
print(max(0,lmax-rmin+1)

Fixed submission:
n,m = map(int, input().split())
lmax,rmin=0,n+1
for i in range(m):
  l,r=map(int, input().split())
  lmax=max(l,lmax)
  rmin=min(r,rmin)
print(max(0,rmin-lmax+1))
Buggy python submission (verdict: Time Limit Exceeded):
from math import floor

r, g, b, n = map(int, input().split())

cnt = 0
for r0 in range(floor(n // r)+1):
  for g0 in range(floor(n // g)+1):
    sum = r * r0 + g * g0
    if sum > n:
      continue
    if (n - sum) % b == 0:
      cnt += 1

print(cnt)
      

Fixed submission:
from math import floor

r, g, b, n = map(int, input().split())
r, g, b = sorted([r, g, b])[::-1]

cnt = 0
for r0 in range(floor(n // r)+1):
  for g0 in range(floor((n-r*r0)// g)+1):
    sum = r * r0 + g * g0
    if sum > n:
      continue
    if (n - sum) % b == 0:
      cnt += 1

print(cnt)
Buggy python submission (verdict: Runtime Error):
a, b, t = map(int, input().split())
return (t % a) * b

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

print(b * (t // a))
Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd

n = int(input())
a = list(map(int, input().split()))

l = [a[0]]
r = [a[-1]]
for i in range(n-1):
  l.append(gcd(l[-1], a[i+1]))
  r.insert(0, gcd(r[0], a[-2-i]))

maxi = max(l[-2], r[1])
for i in range(1, n-1):
  maxi = max(maxi, gcd(l[i-1], r[i+1]))
print(maxi)


Fixed submission:
from fractions import gcd

n = int(input())
a = list(map(int, input().split()))

l = [a[0]]
r = [a[-1]]
for i in range(n-1):
  l.append(gcd(l[-1], a[i+1]))
  r.append(gcd(r[-1], a[-2-i]))
r = r[::-1]

maxi = max(l[-2], r[1])
for i in range(1, n-1):
  maxi = max(maxi, gcd(l[i-1], r[i+1]))
print(maxi)

Buggy python submission (verdict: Runtime Error):
n = int(input())
an = list(map(int, input().split(' ')))
an = list(set(an))
if len(an) == 1:
  print(an[0])
  exit()
  
from fractions import gcd
from functools import reduce
import copy

max_g = 1
g0 = reduce(gcd, an)
for i in range(n):
  bn = copy.copy(an)
  bn.pop(i)
  g = reduce(gcd, bn)
  max_g = max(g, max_g)
print(max_g)

Fixed submission:
from fractions import gcd

n = int(input())
a = list(map(int, input().split()))

l = [a[0]]
r = [a[-1]]
for i in range(n-1):
  l.append(gcd(l[-1], a[i+1]))
  r.append(gcd(r[-1], a[-2-i]))
r = r[::-1]

maxi = max(l[-2], r[1])
for i in range(1, n-1):
  maxi = max(maxi, gcd(l[i-1], r[i+1]))
print(maxi)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
an = list(map(int, input().split(' ')))

from fractions import gcd
from functools import reduce
import copy

max_g = 1
for i in range(n):
  bn = copy.copy(an)
  bn.pop(i)
  g = reduce(gcd, bn)
  max_g = max(g, max_g)
print(max_g)

Fixed submission:
from fractions import gcd

n = int(input())
a = list(map(int, input().split()))

l = [a[0]]
r = [a[-1]]
for i in range(n-1):
  l.append(gcd(l[-1], a[i+1]))
  r.append(gcd(r[-1], a[-2-i]))
r = r[::-1]

maxi = max(l[-2], r[1])
for i in range(1, n-1):
  maxi = max(maxi, gcd(l[i-1], r[i+1]))
print(maxi)
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split(' '))
s = input()
if k >= n:
  print(n)
  exit()
  
s10 = []
cnt = 0
s_prev = '1'
for si in s+'x':
  if si == s_prev:
    cnt += 1
  else:
    s10.append(cnt)
    cnt = 1
  s_prev = si
if s[-1] == '0':
  s10.append(0)
if len(s10) < 2*k + 1:
  print(n)
  exit()

sum_max= 0
for i in range(len(s10)//2+1):
  sum_i = sum(s10[2*i:2*i+2*k+1])
  sum_max = max(sum_i, sum_max)
  
print(sum_max)

Fixed submission:
n, k = map(int, input().split(' '))
s = input()
if k >= n:
  print(n)
  exit()
  
s10 = []
cnt = 0
s_prev = '1'
for si in s+'x':
  if si == s_prev:
    cnt += 1
  else:
    s10.append(cnt)
    cnt = 1
  s_prev = si
if s[-1] == '0':
  s10.append(0)
if len(s10) < 2*k + 1:
  print(n)
  exit()

sum_i = sum(s10[:2*k+1])
sum_max= sum_i

for i in range(len(s10)//2-k):
  sum_i += (s10[2*i + 2*k + 1] + s10[2*i + 2*k + 2] - s10[2*i] - s10[2*i+1])
  sum_max = max(sum_i, sum_max)
  
print(sum_max)

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split(' '))
s = input()
s10 = []
cnt = 0
s_prev = '1'
for si in s+'x':
  if si == s_prev:
    cnt += 1
  else:
    s10.append(cnt)
    cnt = 1
  s_prev = si
if s[-1] == '0':
  s10.append(0)

sum_max= 0
for i in range(len(s10)//2+1):
  sum_i = sum(s10[2*i:2*i+2*k+1])
  sum_max = max(sum_i, sum_max)
  
print(sum_max)

Fixed submission:
n, k = map(int, input().split(' '))
s = input()
if k >= n:
  print(n)
  exit()
  
s10 = []
cnt = 0
s_prev = '1'
for si in s+'x':
  if si == s_prev:
    cnt += 1
  else:
    s10.append(cnt)
    cnt = 1
  s_prev = si
if s[-1] == '0':
  s10.append(0)
if len(s10) < 2*k + 1:
  print(n)
  exit()

sum_i = sum(s10[:2*k+1])
sum_max= sum_i

for i in range(len(s10)//2-k):
  sum_i += (s10[2*i + 2*k + 1] + s10[2*i + 2*k + 2] - s10[2*i] - s10[2*i+1])
  sum_max = max(sum_i, sum_max)
  
print(sum_max)
Buggy python submission (verdict: Runtime Error):
def col(a):
  if a % 2 == 0:
    return a//2
  else:
    return a*3 + 1

s = int(input())

an = [a]
i = 1
while True:
  i += 1
  an_1 = col(an[-1])
  if an_1 in an:
    break
  an.append(an_1)

print(i)

Fixed submission:
def col(a):
  if a % 2 == 0:
    return a//2
  else:
    return a*3 + 1

s = int(input())

an = [s]
i = 1
while True:
  i += 1
  an_1 = col(an[-1])
  if an_1 in an:
    break
  else:
    an.append(an_1)

print(i)

Buggy python submission (verdict: Runtime Error):
def col(a):
  if a % 2 == 0:
    return a//2
  else:
    return a*3 + 1

s = int(input())

an = [a]
i = 1
while True:
  i += 1
  an_1 = col(a)
  if an_1 in an:
    break
  an.append(an_1)

print(i)

Fixed submission:
def col(a):
  if a % 2 == 0:
    return a//2
  else:
    return a*3 + 1

s = int(input())

an = [s]
i = 1
while True:
  i += 1
  an_1 = col(an[-1])
  if an_1 in an:
    break
  else:
    an.append(an_1)

print(i)
Buggy python submission (verdict: Runtime Error):
n = list(map(int, input().split()))
if 1 in n:
  if 4 in n:
    if 7 in n:
      if 9 in n:
        print(‘YES’)
        exit()
print(‘NO’)

Fixed submission:
n = list(map(int, input().split()))
if 1 in n:
  if 4 in n:
    if 7 in n:
      if 9 in n:
        print('YES')
        exit()
print('NO')

Buggy python submission (verdict: Runtime Error):
n = map(int, input().split())
if 1 in n:
  if 4 in n:
    if 7 in n:
      if 9 in n:
        print(‘YES’)
        exit()
print(‘NO’)

Fixed submission:
n = list(map(int, input().split()))
if 1 in n:
  if 4 in n:
    if 7 in n:
      if 9 in n:
        print('YES')
        exit()
print('NO')
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
an = list(map(int, input().split()))

an.sort()
dn = [-1 for _ in range(n - k + 1)]
for i in range(n - k + 1):
  dn[i] = an[i+k] - an[i]

print(min(dn))

  

Fixed submission:
n, k = map(int, input().split())
an = []
for _ in range(n):
  an.append(int(input()))

an.sort()
dn = [-1 for _ in range(n - k + 1)]
for i in range(n - k + 1):
  dn[i] = an[i+k-1] - an[i]

print(min(dn))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
xy = []
for _ in range(n):
  x, y, h = map(int, input().split())
  xy.append((x, y, h))

def check(cx, cy):
  x, y, h = xy[0]
  ch = h + abs(cx - x) + abs(cy - y)
  if h > 0:
    ch0 = [ch]
  else:
    ch0 = [i for i in range(1, ch+1)]
  
  for (x, y, h) in xy[1:]:
    ch = h + abs(cx - x) + abs(cy - y)
    if h > 0:
      ch0 = [i for i in ch0 if i == ch]
    else:
      ch0 = [i for i in ch0 if i <= ch]
    
    if len(ch0) == 0:
      return False
  return ch0[0]

for cx in range(101):
  for cy in range(101):
    ch = check(cx, cy)
    if ch:
      print(' '.join( map(str, [cx, cy, ch]) ))
      exit()



Fixed submission:
n = int(input())
xy = []
for _ in range(n):
  x, y, h = map(int, input().split())
  xy.append((x, y, h))

def check(cx, cy):
  x, y, h = xy[0]
  ch = h + abs(cx - x) + abs(cy - y)
  if h > 0:
    ch0 = [ch]
  else:
    ch0 = [i for i in range(1, ch+1)]
  
  for (x, y, h) in xy[1:]:
    ch = h + abs(cx - x) + abs(cy - y)
    if h > 0:
      ch0 = [i for i in ch0 if i == ch]
    else:
      ch0 = [i for i in ch0 if i <= ch]
    
    if len(ch0) == 0:
      return False
  return ch0[0]

for cx in range(101):
  for cy in range(101):
    ch = check(cx, cy)
    if ch:
      print(' '.join( map(str, [cx, cy, ch]) ))
      exit()
Buggy python submission (verdict: Runtime Error):
x1, y1, x2, y2 = map(int, input().split())
x3 = x2 - y1 + y2
y3 = y2 - x1 + x2
x4 = x3 + y2 - y3
x4 = y3 - x2 + x3
print(' '.join( list(map(str, [x3, y3, x4, y4])) ))

Fixed submission:
x1, y1, x2, y2 = map(int, input().split())
x3 = x2 + y1 - y2
y3 = y2 - x1 + x2
x4 = x3 + y2 - y3
y4 = y3 - x2 + x3
print(' '.join( map(str, [x3, y3, x4, y4]) ))
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
k = int(input())
day = 5 * (10 ** 15)

for c in s:
  i = int(c)
  l = i ** day
  if k <= l:
    print(c)
    exit()
  else:
    k -= l

Fixed submission:
s = input()
k = int(input())

for c in s:
  if c != '1':
    print(c)
    exit()
  else:
    k -= 1
    if k == 0:
      print(1)
      exit()
print(1)
Buggy python submission (verdict: Runtime Error):
n = int(input().split())
an = list(map(int, input().split()))
print(max(an) - min(an))

Fixed submission:
n = int(input())
an = list(map(int, input().split()))
print(max(an) - min(an))
Buggy python submission (verdict: Runtime Error):
A, B, C, D, E = map(int, input().split())
if A == 0:
    print(1)
elif B == 0:
    print(2)
elif C == 0:
    print(3)
elif D == 0:
    print(4)
else E == 0:
    print(5)


Fixed submission:
A, B, C, D, E = map(int, input().split())
if A == 0:
    print(1)
elif B == 0:
    print(2)
elif C == 0:
    print(3)
elif D == 0:
    print(4)
elif E == 0:
    print(5)
Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce

k = int(input())
a = 0

for i in range(1, k + 1):
    for l in range(1, k + 1):
        for m in range(1, k + 1):
            a += reduce(math.gcd, [i, l, m])
print(a)


Fixed submission:
import math
from functools import reduce

k = int(input())
a = 0

for i in range(1, k + 1):
    for l in range(1, k + 1):
        for m in range(1, k + 1):
            a += reduce(math.gcd, [i, l, m])
print(a)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

k = int(input())

a = 0

for i in range(1, k + 1):
    for l in range(1, k + 1):
        for m in range(1, k + 1):
            a += np.gcd.reduce([i, l, m])
print(a)


Fixed submission:
import math
from functools import reduce

k = int(input())
a = 0

for i in range(1, k + 1):
    for l in range(1, k + 1):
        for m in range(1, k + 1):
            a += reduce(math.gcd, [i, l, m])
print(a)
Buggy python submission (verdict: Runtime Error):
# coding: utf-8

h, w = map(int, input().split())

m = (h * w)

if m % 2 == 0:
    print(int(m / 2))
else:
    print(int(m / 2) + 1)


Fixed submission:
# coding: utf-8

a = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
b = int(input()) - 1

print(a[b])