Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
S = input()
S=str(S)
N = len(S)
temp = S[0:(N-1)/2]
temp2 = S[(N+2)/2:N]
print("Yes") if temp == temp[::-1] and temp2 == temp2[::-1] else "No"

Fixed submission:
s = input()
if s == s[::-1]:
    flag = True
else:
    flag = False
N = len(s)
if flag:
    new = s[0:int((N-1)/2)]
    if new == new[::-1]:
        flag = True
    else: flag = False

if flag:
    new = s[int((N+2)/2):N]
    if new == new[::-1]:
        flag = True
    else:
        flag = False

if flag:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
S = input()
N = len(str(S))
temp = S[0:(N-1)/2]
temp2 = S[(N+2)/2:N]
print("Yes") if temp == temp[::-1] and temp2 == temp2[::-1] else "No"

Fixed submission:
s = input()
if s == s[::-1]:
    flag = True
else:
    flag = False
N = len(s)
if flag:
    new = s[0:int((N-1)/2)]
    if new == new[::-1]:
        flag = True
    else: flag = False

if flag:
    new = s[int((N+2)/2):N]
    if new == new[::-1]:
        flag = True
    else:
        flag = False

if flag:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
S = input()
N = len(S)
temp = S[0:(N-1)/2]
temp2 = S[(N+2)/2:N]
print("Yes") if temp == temp[::-1] and temp2 == temp2[::-1] else "No"

Fixed submission:
s = input()
if s == s[::-1]:
    flag = True
else:
    flag = False
N = len(s)
if flag:
    new = s[0:int((N-1)/2)]
    if new == new[::-1]:
        flag = True
    else: flag = False

if flag:
    new = s[int((N+2)/2):N]
    if new == new[::-1]:
        flag = True
    else:
        flag = False

if flag:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
N = int(input())
d = [input().split() for i in range(N)]
print(len(set(d)))

Fixed submission:
N = int(input())
d = [input() for i in range(N)]
print(len(set(d)))
Buggy python submission (verdict: Runtime Error):
n, a, b = map(int, input().split())
cnt = 0
for i in range(1, N+1):
    if a <= sum(list(map(int, str(i)))) <= b:
        cnt += i
print(cnt)

Fixed submission:
n, a, b = map(int, input().split())
cnt = 0
for i in range(1, n+1):
    if a <= sum(list(map(int, list(str(i))))) <= b:
        cnt += i
print(cnt)
Buggy python submission (verdict: Runtime Error):
a = list(map(input().split()))
cnt = 0

while all(i%2==0 for i in a):
         a = [i/2 for i in a]
         cnt += 1
         print(cnt)

Fixed submission:
n = input()
a = list(map(int, input().split()))
cnt = 0
while all(i%2==0 for i in a):
    a = [i/2 for i in a]
    cnt += 1
print(cnt)

Buggy python submission (verdict: Runtime Error):
a = list(map(input().split())
cnt = 0

while all(i%2==0 for i in a):
         a = [i/2 for i in a]
         cnt += 1
         print(cnt)

Fixed submission:
n = input()
a = list(map(int, input().split()))
cnt = 0
while all(i%2==0 for i in a):
    a = [i/2 for i in a]
    cnt += 1
print(cnt)

Buggy python submission (verdict: Runtime Error):
a = list(map(input().split())
cnt = 0

while all(i%2==0 for i in a):
         a = [i/2 for i in a]
         cnt += 1
         print(cnt)

Fixed submission:
n = input()
a = list(map(int, input().split()))
cnt = 0
while all(i%2==0 for i in a):
    a = [i/2 for i in a]
    cnt += 1
print(cnt)
Buggy python submission (verdict: Runtime Error):
def hoge():
    X = int(input())
    for a in range(0,int(X**(1/5))+1):
        for b in range(0,a):
            #print(a,b)
            if a**5+b**5 == X:
                return (a,-b)
            elif a**5 - b**5 ==X:
                return (a,b)


result = hoge()
print(result[0], result[1])       


Fixed submission:
def hoge():
    X = int(input())
    for a in range(0,int(X**(1/5))+1):
        for b in range(0,a+1):
            if a**5+b**5 == X:
                return (a,-b)
    for a in range(int(X**(1/5)),10**9):
        for b in range(0,a+1):
            if a**5-b**5 == X:
                return (a,b)


result = hoge()
print(result[0], result[1])
Buggy python submission (verdict: Runtime Error):
import math
a, b, c, d = map(int, input().split())

if math.ceil(a/d) >= math.ceil(c/b):
    print("Yes")
else:
    print("No")

Fixed submission:
a, b = map(int, input().split())
if a>b:
    print("safe")
else:
    print("unsafe")
Buggy python submission (verdict: Runtime Error):
-*- coding: utf-8 -*-
# 整数の入力
a = int(input()) #1
# スペース区切りの整数の入力
b, c = map(int, input().split()) #2 3
# 文字列の入力
s = input()
# 出力
#print("{} {}".format(a+b+c, s))
print(str(a+b+c) + " " + s)

Fixed submission:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
N, M = map(int, input().split())
if N == M:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
import sys
import math

lines = sys.stdin.readlines()

X = lines[0].split(' ')
A = int(X[0])
B = int(X[1])
N = int(X[2])

m = A // B
j = A % B

if N >=B-1:
    print(m*(B-1)-1+j)
else:
    k = B-N
    print(max(0,j+m*N-math.ceil(j*k/B))
    

Fixed submission:
import sys
import math

lines = sys.stdin.readlines()

X = lines[0].split(' ')
A = int(X[0])
B = int(X[1])
N = int(X[2])

m = A // B
j = A % B

if N >=B-1:
    print(max(0,m*(B-1)-1+j))
else:
    k = B-N
    print(max(0,j+m*N-math.ceil(j*k/B)))
Buggy python submission (verdict: Runtime Error):
import sys
lines = sys.stdin.readlines()

S = str(input())

#10**nのmod計算
A = []
p =1
for i in range(len(S)):
  A.append(p)
  p = p*10%2019

#左からi文字以降の数字列のmod計算
X = []
a = 0
for i in range(len(S)):
  a = (a + int(S[len(S)-i-1])*A[i]) %2019
  X.append(a)
X.sort()
flag =1
n = 0

#modが同じになる組み合わせ、またはもともとmodが0になる数字列の個数の総和計算
for i in range(len(X)-1):
  if X[i]==0:
    n +=1
  if X[i]==X[i+1]:
    flag += 1
  else:
    n += flag*(flag-1)//2
    flag = 1
print(n)

Fixed submission:
import sys

lines = sys.stdin.readlines()

x = lines[0].split(' ')
S =int(x[0])
W =int(x[1])

if S > W:
    ans = 'safe'
else:
    ans = 'unsafe'

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
import math

lines = sys.stdin.readlines()
N = int(lines[0])
X = []

for i in range(N):
  Si = str(lines[i+1].split('\n')[0])
  X = X + [Si]

X.sort()

z = 1
for i in range(N-1):
  if X[i] != X[i+1]:
    z +=1
print(z)


Fixed submission:
import sys
import math

lines = sys.stdin.readlines()
N = int(lines[0])
X = []

for i in range(N):
  Si = str(lines[i+1].split('\n')[0])
  X.append(Si)

X.sort()

z = 1
for i in range(N-1):
  if X[i] != X[i+1]:
    z +=1
print(z)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
import math

lines = sys.stdin.readlines()

N = int(lines[0])
X = set([])

for i in range(N):
  Si = str(lines[i+1].split('\n')[0])
  X = X | set([Si])

print(len(X))

Fixed submission:
import sys
import math

lines = sys.stdin.readlines()
N = int(lines[0])
X = []

for i in range(N):
  Si = str(lines[i+1].split('\n')[0])
  X.append(Si)

X.sort()

z = 1
for i in range(N-1):
  if X[i] != X[i+1]:
    z +=1
print(z)
Buggy python submission (verdict: Time Limit Exceeded):
A,B,N=map(int,input().split())
M=0
if B<N:
	C=B
else:
	C=N
for i in range(C+1):
	x=int(A*i/B)
	y=int(i/B)
	z=x-A*y
	if M<z:
		M=z
print(M)

Fixed submission:
A,B,N=map(int,input().split())
if B==N:
	C=B-1
elif B<N:
	C=B-1
else:
	C=N
x=int(A*C/B)
y=int(C/B)
z=x-A*y
print(z)

Buggy python submission (verdict: Time Limit Exceeded):
A,B,N=map(int,input().split())
M=0

for i in range(N+1):
	x=int(A*i/B)
	y=int(i/B)
	z=x-A*y
	if M<z:
		M=z
print(M)

Fixed submission:
A,B,N=map(int,input().split())
if B==N:
	C=B-1
elif B<N:
	C=B-1
else:
	C=N
x=int(A*C/B)
y=int(C/B)
z=x-A*y
print(z)
Buggy python submission (verdict: Runtime Error):
A B C=map(int,input().split())
print(C,A,B)

Fixed submission:
A,B,C=map(int,input().split())
print(C,A,B)
Buggy python submission (verdict: Runtime Error):
hoge = list(map(int, input().split()))
huga = sorted(hoge)
if huga == [5,5,7]:
  print("YES")
elif:
  print("NO")


Fixed submission:
hoge = list(map(int, input().split()))
huga = sorted(hoge)
if huga == [5,5,7]:
  print("YES")
else:
  print("NO")

Buggy python submission (verdict: Runtime Error):
hoge = list(map(int, input().split()))
huga = hoge.sort()
if huga == [5,5,7]:
  print("YES")
elif:
  print("NO")

Fixed submission:
hoge = list(map(int, input().split()))
huga = sorted(hoge)
if huga == [5,5,7]:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))

for i in range(N):
    print(A.count(i+1))


Fixed submission:
N = int(input())
A = list(map(int, input().split()))
cnt = []
[cnt.append(0) for _ in range(len(A))]

for i in A:
    cnt[i-1] += 1

for i in range(N-1):
    print(cnt[i])

print("0")
Buggy python submission (verdict: Runtime Error):
import math.fact
N, K = map(int, input().split())

def combination_mod(n, r, mod):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n-r)
    return fact[n] * factinv[r] * factinv[n-r] % mod

mod = 10**9+7
fact = [1, 1]
factinv = [0, 1]
inv = [0, 1]
total = 0

for i in range(2, N+1):
    fact.append((fact[-1] * i) % mod)
    inv.append((-inv[mod % i] * (mod // i)) % mod)
    factinv.append((factinv[-1] * inv[-1]) % mod)

for i in range(K, N+1):
    total += combination_mod(N, i, mod) % mod

print(total)


Fixed submission:
N, K = map(int, input().split())

total = 0
mod = 10**9+7
s = [0]
for i in range(0, N+1):
    s.append(s[-1] + i)

for i in range(K, N+2):
    total = (total + ((s[-1]-s[-(i+1)]) - s[i] + 1)) % mod
print(total)
Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce

N = int(input())

def gcd_list(nums):
    return reduce(math.gcd, nums)

total = 0

for a in range(N):
    for b in range(N):
        for c in range(N):
            total += gcd_list([a+1, b+1, c+1])

print(total)

Fixed submission:
import math
from functools import reduce

N = int(input())

def gcd_list(nums):
    return reduce(math.gcd, nums)

total = 0

for a in range(N):
    for b in range(N):
        for c in range(N):
            total += gcd_list([a+1, b+1, c+1])

print(total)
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())

while abs(N - K) < N:
    N = abs(N - K)

print(N)


Fixed submission:
N, K = map(int, input().split())

N %= K

while abs(N - K) < N:
    N = abs(N - K)

print(N)
Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())

if a == b and b == c:
    print("Yes")
else:
    print("No")

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

if a == b and b == c:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
for i in range(1,N+1):
    print(A.count(i))


Fixed submission:
import collections
N = int(input())
A = list(map(int,input().split()))
c = collections.Counter(A)
for i in range(1,N+1):
    print(c[i])
Buggy python submission (verdict: Time Limit Exceeded):
import math
K = int(input())
ans = 0
for i in range(K):
    for j in range(K):
        for k in range(K):
            ans = ans + math.gcd(math.gcd(i+1,j+1),k+1)
print(ans)


Fixed submission:
import math
K = int(input())
ans = 0
for i in range(1,K+1,1):
    for j in range(i,K+1,1):
        for k in range(j,K+1,1):
            if i == j and j==k:
                ans = ans + math.gcd(math.gcd(i,j),k)
            elif i == j and j != k:
                ans = ans + 3*math.gcd(math.gcd(i,j),k)
            elif i != j and j == k:
                ans = ans + 3*math.gcd(math.gcd(i,j),k)
            elif i != j and j != k:
                ans = ans + 6*math.gcd(math.gcd(i,j),k)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import collections
N = int(input())
A = list(map(int,input().split()))
ans = 0
c = collections.Counter(A)
for k in range(N):
    buf = A[k]
    ans = 0
    A[k] = 0
    c = collections.Counter(A)
    if (max(c.values())==1):
        print(0)
        A[k] = buf
        continue
    for l in c.values():
        ans = ans + l*(l-1)/2
    print(int(ans))
    A[k] = buf


Fixed submission:
import collections
N = int(input())
A = list(map(int,input().split()))
ans = 0
c = collections.Counter(A)
for l in c.values():
    ans = ans + l*(l-1)/2
for k in A:
    print(int(ans-(c[k]-1)))

Buggy python submission (verdict: Time Limit Exceeded):
import collections
N = int(input())
A = list(map(int,input().split()))
ans = 0
for k in range(N):
    buf = A[k]
    ans = 0
    A[k] = 0
    c = collections.Counter(A)
    for l in c.values():
        ans = ans + l*(l-1)/2
    print(int(ans))
    A[k] = buf


Fixed submission:
import collections
N = int(input())
A = list(map(int,input().split()))
ans = 0
c = collections.Counter(A)
for l in c.values():
    ans = ans + l*(l-1)/2
for k in A:
    print(int(ans-(c[k]-1)))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
ans = 0
for k in range(N):
    buf = A[k]
    ans = 0
    A[k] = 0
    for l in range (N-1):
        ans = ans + (A.count(l+1))*(A.count(l+1)-1)/2
    print(int(ans))
    A[k] = buf


Fixed submission:
import collections
N = int(input())
A = list(map(int,input().split()))
ans = 0
c = collections.Counter(A)
for l in c.values():
    ans = ans + l*(l-1)/2
for k in A:
    print(int(ans-(c[k]-1)))
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
def main():
    N,K = map(int, input().split())
    p = np.array(list(map(int,input().split())))
    p = (p+1)/2
    ans = 0.0
    for i in range(N-K+1):
        buf = sum(p[i:i+K])
        if ans < buf:
            ans = buf
    print(ans)

if __name__ == '__main__':
    main()


Fixed submission:
import numpy as np
N,K = map(int, input().split())
p = [(int(i)+1)/2 for i in input().split()]
s = [0]*N
s[0] = p[0]
if N==K:
    print(sum(p))
else:
    for i in range(N-1):
        s[i+1] = s[i]+p[i+1]
    ans=max(s[i+K]-s[i] for i in range(N-K))
    print(ans)

Buggy python submission (verdict: Runtime Error):
import numpy as np
def main():
N,K = map(int, input().split())
p = np.array(list(map(int,input().split())))
p = (p+1)/2
ans = 0.0
for i in range(N-K+1):
    buf = sum(p[i:i+K])
    if ans < buf:
        ans = buf
print(ans)

if __name__ == '__main__':
    main()


Fixed submission:
import numpy as np
N,K = map(int, input().split())
p = [(int(i)+1)/2 for i in input().split()]
s = [0]*N
s[0] = p[0]
if N==K:
    print(sum(p))
else:
    for i in range(N-1):
        s[i+1] = s[i]+p[i+1]
    ans=max(s[i+K]-s[i] for i in range(N-K))
    print(ans)

Buggy python submission (verdict: Runtime Error):
import numpy as np
N,K = map(int, input().split())
p = np.array(list(map(int,input().split())))
p = (p+1)/2
sorted_p = np.sort(p)[::-1]
ans = sum(sorted_p[0:K])
print(ans)


Fixed submission:
import numpy as np
N,K = map(int, input().split())
p = [(int(i)+1)/2 for i in input().split()]
s = [0]*N
s[0] = p[0]
if N==K:
    print(sum(p))
else:
    for i in range(N-1):
        s[i+1] = s[i]+p[i+1]
    ans=max(s[i+K]-s[i] for i in range(N-K))
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N,K = map(int, input().split())
p = np.array(list(map(int,input().split())))
p = (p+1)/2
ans = 0.0
for i in range(N-K+1):
    buf = sum(p[i:i+K])
    if ans < buf:
        ans = buf
print(ans)


Fixed submission:
import numpy as np
N,K = map(int, input().split())
p = [(int(i)+1)/2 for i in input().split()]
s = [0]*N
s[0] = p[0]
if N==K:
    print(sum(p))
else:
    for i in range(N-1):
        s[i+1] = s[i]+p[i+1]
    ans=max(s[i+K]-s[i] for i in range(N-K))
    print(ans)

Buggy python submission (verdict: Runtime Error):
import numpy as np
N,K = map(int, input().split())
p = np.array(list(map(int,input().split())))
p = (p+1)/2
ans = 0.0
for i in range(N-K+1):
    buf = sum(p[i:i+K])
    if ans < buf:
        ans = buf
print(ans)


Fixed submission:
import numpy as np
N,K = map(int, input().split())
p = [(int(i)+1)/2 for i in input().split()]
s = [0]*N
s[0] = p[0]
if N==K:
    print(sum(p))
else:
    for i in range(N-1):
        s[i+1] = s[i]+p[i+1]
    ans=max(s[i+K]-s[i] for i in range(N-K))
    print(ans)
Buggy python submission (verdict: Runtime Error):
import numpy as np

N,M = [int(i) for i in input().split(" ")]
H = [int(i) for i in input().split(" ")]
mh = np.zeros([N])
for i in range(M):
    a,b = [int(i)-1 for i in input().split(" ")]
    mh[a] = max(mh[a],h[b])
    mh[b] = max(mh[b],h[a])

ans = 0
for i in range(N):
    if mh[i] < h[i]:
        ans += 1

print(ans)

Fixed submission:
import numpy as np

N,M = [int(i) for i in input().split(" ")]
H = [int(i) for i in input().split(" ")]
mh = np.zeros([N])
for i in range(M):
    a,b = [int(i)-1 for i in input().split(" ")]
    mh[a] = max(mh[a],H[b])
    mh[b] = max(mh[b],H[a])

ans = 0
for i in range(N):
    if mh[i] < H[i]:
        ans += 1

print(ans)

Buggy python submission (verdict: Runtime Error):
import numpy as np

N,M = [int(i) for i in input().split(" ")]
H = [int(i) for i in input().split(" ")]
root = np.zeros([N,N],dtype='int16')
for i in range(M):
    a,b = [int(i)-1 for i in input().split(" ")]
    root[a,b] = 1
    root[b,a] = 1

ans = 0
for i in range(N):
    count = 0
    for l in range(N):
        if root[i,l] == 1 and H[i] <= H[l]:
            count = 1
    if count == 0:
        ans += 1
    
print(ans)

Fixed submission:
import numpy as np

N,M = [int(i) for i in input().split(" ")]
H = [int(i) for i in input().split(" ")]
mh = np.zeros([N])
for i in range(M):
    a,b = [int(i)-1 for i in input().split(" ")]
    mh[a] = max(mh[a],H[b])
    mh[b] = max(mh[b],H[a])

ans = 0
for i in range(N):
    if mh[i] < H[i]:
        ans += 1

print(ans)

Buggy python submission (verdict: Runtime Error):
import numpy as np

N,M = [int(i) for i in input().split(" ")]
H = [int(i) for i in input().split(" ")]
root = np.zeros([N,N])
for i in range(M):
    a,b = [int(i)-1 for i in input().split(" ")]
    root[a,b] = 1
    root[b,a] = 1

ans = 0
for i in range(N):
    count = 0
    for l in range(N):
        if root[i,l] == 1 and H[i] <= H[l]:
            count = 1
    if count == 0:
        ans += 1
    
print(ans)

Fixed submission:
import numpy as np

N,M = [int(i) for i in input().split(" ")]
H = [int(i) for i in input().split(" ")]
mh = np.zeros([N])
for i in range(M):
    a,b = [int(i)-1 for i in input().split(" ")]
    mh[a] = max(mh[a],H[b])
    mh[b] = max(mh[b],H[a])

ans = 0
for i in range(N):
    if mh[i] < H[i]:
        ans += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
K = int(input())
A,B=[int(i) for i in input().split(" ")]
if A%K == 0　or (A//K+1)*K <= B:
    print("OK")
else:
    print("NG")

Fixed submission:
#[str(i) for i in input().split(" ")]
K = int(input())
A,B=[int(i) for i in input().split(" ")]
if A%K == 0:
    print("OK")
elif (A//K+1)*K <= B:
    print("OK")
else:
    print("NG")
Buggy python submission (verdict: Runtime Error):
import numpy as np
N = int(input())
narray = np.arange(1,N+1)
P = np.hstack((narray , narray))
ans = 0
A = []
for i in range(N):
  for l in range(N):
    ans += narray[l] % P[i+l]
  A.append(ans)
  ans = 0
print(max(A))

Fixed submission:
N = int(input())

print(N*(N-1)//2)
Buggy python submission (verdict: Time Limit Exceeded):
res = {}
for i in range(-1000, 1000):
    for j in range(-1000, 1000):
        ans = i ** 5 - j ** 5
        res[ans] = (i, j)
n = int(input())
print(res[n][0], res[n][1])


Fixed submission:
res = {}
for i in range(-500, 500):
    for j in range(-500, 500):
        ans = i ** 5 - j ** 5
        res[ans] = (i, j)
n = int(input())
print(res[n][0], res[n][1])

Buggy python submission (verdict: Runtime Error):
res = {}
for i in range(-100, 100):
    for j in range(-100, 100):
        ans = i ** 5 - j ** 5
        res[ans] = (i, j)
n = int(input())
print(res[n][0], res[n][1])


Fixed submission:
res = {}
for i in range(-500, 500):
    for j in range(-500, 500):
        ans = i ** 5 - j ** 5
        res[ans] = (i, j)
n = int(input())
print(res[n][0], res[n][1])
Buggy python submission (verdict: Runtime Error):
r = input()
R = 2*3.1415*r
print(R)


Fixed submission:
r = int(input())
R = 2*3.1415*r
print(R)
Buggy python submission (verdict: Runtime Error):
a=input()
b=a/3
print(b**3)
exit()

Fixed submission:
a = int(input())
b=a/3
print(b**3)
exit()

Buggy python submission (verdict: Runtime Error):
a=input()
b=a/3
print(b**3)
exit(0)

Fixed submission:
a = int(input())
b=a/3
print(b**3)
exit()
Buggy python submission (verdict: Runtime Error):
S = input()
 
if S = "ABC":
    print("ARC")
else:
    print("ABC")

Fixed submission:
S = input()
 
if S == "ABC":
    print("ARC")
else:
    print("ABC")

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

if S = "ABC":
    print("ARC")
else:
    print("ABC")

Fixed submission:
S = input()
 
if S == "ABC":
    print("ARC")
else:
    print("ABC")
Buggy python submission (verdict: Runtime Error):
X = []
Y = []
Z = []
for i in range(3):
    x, y, z = map(str, input().split())
    X.append(x)
    Y.append(y)
    Z.append(z)
N = int(input())

b = map(str, [input() for i in range(N)])

for x in sorted(b, reverse=True):
    X = [s.replace(x, 'OK') for s in X]
    Y = [s.replace(x, 'OK') for s in Y]
    Z = [s.replace(x, 'OK') for s in Z]

if ('OK' in X[0] and 'OK' in X[1] and 'OK' in X[2]
    or 'OK' in Y[0] and 'OK' in Y[1] and 'OK' in Y[2]
    or 'OK' in Z[0] and 'OK' in Z[1] and 'OK' in Z[2]
    or 'OK' in X[0] and 'OK' in Y[0] and 'OK' in Z[0]
    or 'OK' in X[1] and 'OK, in Y[1] and 'OK' in Z[1]
    or 'OK' in X[2] and 'OK' in Y[2] and 'OK' in Z[2]
    or 'OK' in X[0] and 'OK' in Y[1] and 'OK' in Z[2]
    or 'OK' in X[2] and 'OK' in Y[1] and 'OK' in Z[0]):
    print('Yes')
else:
    print('No')

Fixed submission:
X = []
Y = []
Z = []
for i in range(3):
    x, y, z = map(int, input().split())
    X.append(x)
    Y.append(y)
    Z.append(z)
N = int(input())

b = list(map(int, [input() for i in range(N)]))

for i in range(N):
    
    if X[0] == b[i]:
        X[0] = 'OK'
    if X[1] == b[i]:
        X[1] = 'OK'
    if X[2] == b[i]:
        X[2] = 'OK'
    if Y[0] == b[i]:
        Y[0] = 'OK'
    if Y[1] == b[i]:
        Y[1] = 'OK'
    if Y[2] == b[i]:
        Y[2] = 'OK'
    if Z[0] == b[i]:
        Z[0] = 'OK'
    if Z[1] == b[i]:
        Z[1] = 'OK'
    if Z[2] == b[i]:
        Z[2] = 'OK'

if (X[0] == X[1] == X[2]
    or Y[0] == Y[1] == Y[2]
    or Z[0] == Z[1] == Z[2]
    or X[0] == Y[0] == Z[0]
    or X[1] == Y[1] == Z[1]
    or X[2] == Y[2] == Z[2]
    or X[0] == Y[1] == Z[2]
    or X[2] == Y[1] == Z[0]):
    print('Yes')
else:
    print('No')