Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
X = []
Y = []
for _ in range(N):
    x, y = map(int, input().split())
    X.append(x)
    Y.append(y)
Xs = sorted(X)
Ys = sorted(Y)
ans = float('inf')
for left in range(N - 1):
    for right in range(left + 1, N):
        for down in range(N - 1):
            for up in range(down + 1, N):
                count = 0
                for i in range(N):
                    if Xs[left] <= X[i] <= Xs[right] and Ys[down] <= Y[i] <= Ys[up]:
                            count += 1
                if count >= K:
                    ans = min(ans, (Xs[right] - Xs[left]) * (Ys[up] - Ys[down]))
print(ans)

Fixed submission:
N, K = map(int, input().split())
X = []
Y = []
for _ in range(N):
    x, y = map(int, input().split())
    X.append(x)
    Y.append(y)
Xs = sorted(X)
Ys = sorted(Y)
ans = float('inf')
for left in range(N - 1):
    for right in range(left + 1, N):
        for down in range(N - 1):
            for up in range(down + 1, N):
                count = 0
                for i in range(N):
                    if Xs[left] <= X[i] <= Xs[right] and Ys[down] <= Y[i] <= Ys[up]:
                            count += 1
                if count >= K:
                    ans = min(ans, (Xs[right] - Xs[left]) * (Ys[up] - Ys[down]))
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
p = list(map(int, input().split()))
i = 0
ans = 0
while(i < N - 1):
    print(p)
    print(' ' * (3 * i + 1) + str(i + 1))
    if p[i] == i + 1:
        ans += 1
        p[i], p[i + 1] = p[i + 1], p[i]
    i += 1
if p[N - 1] == N:
    ans += 1
print(ans)

Fixed submission:
N = int(input())
p = list(map(int, input().split()))
i = 0
ans = 0
while(i < N - 1):
    if p[i] == i + 1:
        ans += 1
        p[i], p[i + 1] = p[i + 1], p[i]
    i += 1
if p[N - 1] == N:
    ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
from math import sqrt, floor
from functools import reduce


def factorization(N):
    s = floor(sqrt(N))
    result = []
    for i in range(2, s + 1):
        if N % i == 0:
            r = 0
            while(N % i == 0):
                N //= i
                r += 1
            result += [i] * r
    if result == []:
        result = [1, N]
    return result


N = int(input())
p = factorization(N)
a = int(reduce(lambda x, y: x * y, p[0::2]))
b = int(reduce(lambda x, y: x * y, p[1::2]))

print(max(len(str(a)), len(str(b))))


Fixed submission:
from math import sqrt, floor
N = int(input())
a = 1
for i in range(2, floor(sqrt(N)) + 10):
    if N % i == 0:
        a = i

print(max(len(str(a)), len(str(N // a))))
Buggy python submission (verdict: Runtime Error):
X, A = map(int, input().split())
if X < A:
    print(0)
else:
    print(10

Fixed submission:
X, A = map(int, input().split())
if X < A:
    print(0)
else:
    print(10)
Buggy python submission (verdict: Runtime Error):
N=int(input())
S=[]
for _ in range(N):
    S.append(list(input()))
# print(S)

count = {
    'M': 0,
    'A': 0,
    'R': 0,
    'C': 0,
    'H': 0
}

for s in S:
    if s[0] in ['M','A','R','C','H']:
        count[s[0]] += 1

# print(count)

H=['M','A','R','C','H']
res = 0
for i in range(0,N):
    for j in range(i+1,N):
        for k in range(j+1,N):
            cnt = count[H[i]] * count[H[j]] * count[H[k]]
            # print(i,j,k,cnt)
            res += cnt

print(res)

Fixed submission:
N=int(input())
S=[]
for _ in range(N):
    S.append(list(input()))
# print(S)

count = {
    'M': 0,
    'A': 0,
    'R': 0,
    'C': 0,
    'H': 0
}

for s in S:
    if s[0] in ['M','A','R','C','H']:
        count[s[0]] += 1

# print(count)

H=['M','A','R','C','H']
res = 0
for i in range(0,5):
    for j in range(i+1,5):
        for k in range(j+1,5):
            cnt = count[H[i]] * count[H[j]] * count[H[k]]
            # print(i,j,k,cnt)
            res += cnt

print(res)
Buggy python submission (verdict: Runtime Error):
from collections import defaultdict

n = int(input())
a = [int(x) for x in input().split()]

cnt = defaultdict(int)
for v in a:
  cnt[v] += 1

ans = 0
for k, v in cnt:
  ans += v*(v-1)//2

for v in a:
  print(ans + (cnt[v]-1)*(cnt[v]-2)//2 - cnt[v]*(cnt[v]-1)//2)

Fixed submission:
from collections import defaultdict

n = int(input())
a = [int(x) for x in input().split()]

cnt = defaultdict(int)
for v in a:
  cnt[v] += 1

ans = 0
for v in cnt:
  ans += cnt[v]*(cnt[v]-1)//2

for v in a:
  print(ans + (cnt[v]-1)*(cnt[v]-2)//2 - cnt[v]*(cnt[v]-1)//2)
Buggy python submission (verdict: Runtime Error):
n, b_n, r_n = input().split()
b= "b" * int(b_n)
r = "r" * int(r_n)

total = (b + r) * int(n)
total = total[:int(n)]

b_n2 = 0
for _ in total:
  if _ == "b":
    b_n2 += 1
  
print(str(b_n2))

Fixed submission:
total = input()
a = total[0]
b = total[1]
c = total[2]
if a != b:
  print("Yes")
elif b != c:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
n, b_n, r_n = input().split()
b= "b" * int(b_n)
r = "r" * int(r_n)

total = (b + r) * int(n)
total = total[:int(n)]

b_n2 = 0
for _ in total:
  if _ == "b":
    b_n2 += 1
  
print(b_n2)

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

c = b + r

print(b*(n//c) + min(n % c, b))

Buggy python submission (verdict: Runtime Error):
n, b_n, r_n = input().split()
b= "b" * int(b_n)
r = "r" * int(r_n)

total = (b + r) * int(n)
total = total[:int(n)]

b_n2 = 0
for _ in total:
  if _ == "b":
    b_n2 += 1
  
print(b_n2)

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

c = b + r

print(b*(n//c) + min(n % c, b))
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = []
for _ in range(N):
    A.append(input())

B = sorted(A, reverse=True)
max_first = B[0]
max_second = B[1]

for i in range(N):
	answer = max_first
    if A[i] == max_first:
        answer = max_second
    print(answer)


Fixed submission:
N = int(input())
A = []
B = []
for _ in range(N):
    temp = int(input())
    A.append(temp)
    B.append(temp)

B.sort(reverse=True)
max_first = B[0]
max_second = B[1]

for i in range(N):
    if A[i] == max_first:
        print(max_second)
    else:
        print(max_first)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = []
for i in range(N):
  A.append(input())

B = sorted(A, reverse=True)
max_first = B[0]
max_second = B[1]
max_third = B[2]

for i in range(N):
  if A[i] != max_first:
    print(max_first)
  elif A[i] != max_second:
    print(max_second)
  else:
    print(max_third)


Fixed submission:
N = int(input())
A = []
B = []
for _ in range(N):
    temp = int(input())
    A.append(temp)
    B.append(temp)

B.sort(reverse=True)
max_first = B[0]
max_second = B[1]

for i in range(N):
    if A[i] == max_first:
        print(max_second)
    else:
        print(max_first)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = []
for i in range(N):
	A.append(input())
 
B = sorted(A, reverse=True, key=number)
max_first = B[0]
max_second = B[1]
max_third = B[2]
 
for i in range(N):
	if A[i] != max_first:
		print(max_first)
    else if A[i] != max_second:
		print(max_second)
    else:
		print(max_third)


Fixed submission:
N = int(input())
A = []
B = []
for _ in range(N):
    temp = int(input())
    A.append(temp)
    B.append(temp)

B.sort(reverse=True)
max_first = B[0]
max_second = B[1]

for i in range(N):
    if A[i] == max_first:
        print(max_second)
    else:
        print(max_first)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = []
for i in range(N):
  A.append(input())
 
B = sorted(A, reverse=True, key=number)
max_first = B[0]
max_second = B[1]
max_third = B[2]
 
for i in range(N):
    if A[i] != max_first:
        print(max_first)
    elif A[i] != max_second:
        print(max_second)
    else:
        print(max_third)

Fixed submission:
N = int(input())
A = []
B = []
for _ in range(N):
    temp = int(input())
    A.append(temp)
    B.append(temp)

B.sort(reverse=True)
max_first = B[0]
max_second = B[1]

for i in range(N):
    if A[i] == max_first:
        print(max_second)
    else:
        print(max_first)
Buggy python submission (verdict: Runtime Error):
n,m=list(map,int().split())
print(n*(n-1)//2+m*(m-1)//2)

Fixed submission:
N,M=map(int,input().split())
ans=N*(N-1)//2+M*(M-1)//2
print(ans)
Buggy python submission (verdict: Runtime Error):
word=list(input())
check=True
for i in range(len(word)//2)
    if word[i]==word[len(word)-1]:
        continue:
    else:
          check=False
          braek:
if check==True:
    print("Yes")
else:
    print("No")


Fixed submission:
S=list(input())
N=len(S)
check=True
for i in range(N//2):
    if S[i]!=S[N-1-i]:
        check=False
        break
if check==False:
    print("No")
else:
    C=False
    for i in range((N//2)//2):
        if S[i]!=S[N//2-1-i]:#0123456
          C=True
          break
    if C==True:
        print("No")
    else:
        print("Yes")

Buggy python submission (verdict: Runtime Error):
word=list(map.string().split())
check=True
for i in range(len(word)//2)
    if word[i]==word[len(word)-1]:
        continue:
    else:
          check=False
          braek:
if check==True:
    print("Yes")
else:
    print("No")

Fixed submission:
S=list(input())
N=len(S)
check=True
for i in range(N//2):
    if S[i]!=S[N-1-i]:
        check=False
        break
if check==False:
    print("No")
else:
    C=False
    for i in range((N//2)//2):
        if S[i]!=S[N//2-1-i]:#0123456
          C=True
          break
    if C==True:
        print("No")
    else:
        print("Yes")
Buggy python submission (verdict: Runtime Error):
M=int(input())
N=list(input().split())
print(N)
check=[0,0,0,0,0,0,0,0,0,0]
for i in range(M):
    check[int(N[i])]+=1
num=0
for i in range(M):
    num+=check[i]*(check[i]-1)//2
for i in range(M):
    print(num-(check[int(N[i])]-1))

Fixed submission:
M=int(input())
N=list(input().split())
check=[0]*M
for i in range(M):
    check[int(N[i])-1]+=1
num=0
for i in range(M):
    num+=check[i]*(check[i]-1)//2
for i in range(M):
    if check[int(N[i])-1]!=2:
        print(num-(check[int(N[i])-1]-1))
    else:
        print(num-1)
Buggy python submission (verdict: Runtime Error):
h,w=map(int,input().split())
if h=1 or w==1:
    print("1")
elif h%2==0:
    print((h*w)//2)
elif w%2==0:
    print((h*w)//2)
else:
    print((w*(h//2))+(w//2)+1)


Fixed submission:
h,w=map(int,input().split())
if h==1 or w==1:
  print("1")
elif h%2==0:
    print((h*w)//2)
elif w%2==0:
    print((h*w)//2)
else:
    print((w*(h//2))+(w//2)+1)

Buggy python submission (verdict: Runtime Error):
h,w=map(int,input().split())
if h=1 or w==1:
  print("1")
elif h%2==0:
    print((h*w)//2)
elif w%2==0:
    print((h*w)//2)
else:
    print((w*(h//2))+(w//2)+1)

Fixed submission:
h,w=map(int,input().split())
if h==1 or w==1:
  print("1")
elif h%2==0:
    print((h*w)//2)
elif w%2==0:
    print((h*w)//2)
else:
    print((w*(h//2))+(w//2)+1)
Buggy python submission (verdict: Runtime Error):
S=str(input())
Q=int(input())
which=0
front=""
back=""
for i in range(Q):
    a=list(map(str,input().split()))
    if a==["1"]:
        which+=1
        which%=2
        continue
    else:
        if which==0:
            if a[1]=="1":
                front=a[2]+front
            if a[1]=="2":
                back+=a[2]
        if which==1:
            if a[1]=="1":
                back+=a[2]
            if a[1]=="2":
                front=a[2]+front
S=front+S+back
if which==1:
    print(S[::-1])
if which==0:
    print(S)

Fixed submission:
check=str(input())
if check=="AAA" or check=="BBB":
    print("No")
else:
    print("Yes")
Buggy python submission (verdict: Time Limit Exceeded):
N,P=map(int,input().split())
S=list(map(int,list(input())))
count=0

if P!=2 and P!=5:
    for i in range(0,N):
        chec=S[i]
        j=0
        while i+j<N:
            chec%=P
            if chec==0:
                count+=1
            j+=1
            if i+j<N:
                chec=chec*10+S[i+j]
if P==2:
    for i in range(N):
        if S[i]%2==0:
            count+=i+1
if P==5:
    for i in range(N):
        if S[i]==0 or S[i]==5:
            count+=i+1
print(count)


            




Fixed submission:
#E
N,P=map(int,input().split())
S=input()
ans=0
if P in (2,5):
    for i,s in enumerate(S):
        if int(s)%P==0:
            ans+=i+1
else:
    cnt=[0 for _ in range(P)]
    CS=0
    PLC=1
    for s in S[::-1]:
        tmp=(int(s)*PLC)%P
        CS=(CS+tmp)%P
        cnt[CS]+=1
        PLC=(PLC*10)%P
        # print(CS)
        # print(cnt)
    for c in cnt:
        ans+=c*(c-1)//2
    ans+=cnt[0]
print(ans)

Buggy python submission (verdict: Runtime Error):
N,P=map(int,input().split())
S=list(map(int,list(input())))
count=0

if P!=2 and P!=5:
    for i in range(0,N):
        chec=S[i]
        j=0
        while i+j<N:
          　　　chec%=P
                if chec==0:
                    count+=1
                j+=1
                if i+j<N:
                    chec=chec*10+S[i+j]
if P==2:
    for i in range(N):
        if S[i]%2==0:
            count+=i+1
if P==5:
    for i in range(N):
        if S[i]==0 or S[i]==5:
            count+=i+1
print(count)


            




Fixed submission:
#E
N,P=map(int,input().split())
S=input()
ans=0
if P in (2,5):
    for i,s in enumerate(S):
        if int(s)%P==0:
            ans+=i+1
else:
    cnt=[0 for _ in range(P)]
    CS=0
    PLC=1
    for s in S[::-1]:
        tmp=(int(s)*PLC)%P
        CS=(CS+tmp)%P
        cnt[CS]+=1
        PLC=(PLC*10)%P
        # print(CS)
        # print(cnt)
    for c in cnt:
        ans+=c*(c-1)//2
    ans+=cnt[0]
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N,P=map(int,input().split())
S=list(input())
count=0

if P!=2 and P!=5:
    for i in range(0,N):
        chec=int(S[i])
        j=0
        while i+j<N:
                if chec%P==0:
                    count+=1
                j+=1
                try:
                    chec=(chec%P)*10+int(S[i+j])
                except:
                    pass
if P==2:
    for i in range(N):
        if int(S[i])%2==0:
            count+=i+1
if P==5:
    for i in range(N):
        if int(S[i])==0 or int(S[i])==5:
            count+=i+1
print(count)


            




Fixed submission:
#E
N,P=map(int,input().split())
S=input()
ans=0
if P in (2,5):
    for i,s in enumerate(S):
        if int(s)%P==0:
            ans+=i+1
else:
    cnt=[0 for _ in range(P)]
    CS=0
    PLC=1
    for s in S[::-1]:
        tmp=(int(s)*PLC)%P
        CS=(CS+tmp)%P
        cnt[CS]+=1
        PLC=(PLC*10)%P
        # print(CS)
        # print(cnt)
    for c in cnt:
        ans+=c*(c-1)//2
    ans+=cnt[0]
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N,K=map(int,input().split())
num=list(map(float,input().split()))
answer=[]
a=0
for i in range(N):
    num[i]=(num[i]+1)/2
for i in range(N-K+1):
    ans=0
    for j in range(K):
        ans+=num[i+j]
    if ans>a:
      a=ans
print(a)

Fixed submission:
N,K=map(int,input().split())
num=list(map(float,input().split()))
a=0
check=0
for i in range(N):
    num[i]=(num[i]+1)/2
    if i<K:
        check+=num[i]
a=check        
for i in range(N-K):
    ans=check-num[i]+num[K+i]
    if ans>a:
        a=ans
    check=ans  
print(a)

Buggy python submission (verdict: Time Limit Exceeded):
N,K=map(int,input().split())
num=list(map(float,input().split()))
#print(num)
answer=[]
for i in range(N):
    num[i]=(num[i]+1)/2
for i in range(N-K+1):
    ans=0
    for j in range(K):
        ans+=num[i+j]
    answer.append(ans)
a=max(answer)
print(a)

Fixed submission:
N,K=map(int,input().split())
num=list(map(float,input().split()))
a=0
check=0
for i in range(N):
    num[i]=(num[i]+1)/2
    if i<K:
        check+=num[i]
a=check        
for i in range(N-K):
    ans=check-num[i]+num[K+i]
    if ans>a:
        a=ans
    check=ans  
print(a)
Buggy python submission (verdict: Runtime Error):
H,A=map(int,input().spkit())
if H%A==0:
    print(H//A)
else:
    print((H//A)+1)

Fixed submission:
H,N=map(int,input().split())
if H%N==0:
    print(H//N)
else:
    print((H//N)+1)
Buggy python submission (verdict: Runtime Error):
A,B=map(int,input().split())
x=min(A,B)
y=max(A,B)
check=1
##x<=y
#####while break##############
if y%x==0:
    print(y)
root=round((x**(1/2)))
#print(root)
else:
    for i in range(2,root):
        if x%i==0 and y%i==0:
            x/=i
            y/=i
            check*=i 
       # print(check)
        i=2
    #print(x,y)
        root=round((x**(1/2)))
    print(int(check*x*y))

      

Fixed submission:
A,B=map(int,input().split())
x=min(A,B)
y=max(A,B)
check=1
##x<=y
#####while break##############
if y%x==0:
    print(y)
#print(root)
else:
    #root=round((x**(1/2)))
    while True:
        through=0
        for i in range(2,int(x)):
            if x%i==0 and y%i==0:
                x/=i
                y/=i
                check*=i 
                through=1
                break
        if through==0:
            break
    print(int(check*x*y))
Buggy python submission (verdict: Runtime Error):
X,Y=map(int,input().split())
mod=10**9+7
"""2a+b=X "2b+a=Yを満たすabの並び替え"""
###a+b=(X+Y)/3,a-b=X-Y
###a,b>=0 かつ X+Y(mod3)==0
if (X+Y)%3!=0:
    print("0")##immposible
else:
    a=((X+Y)//3+(X-Y))/2
    b=((X+Y)//3-(X-Y))/2
    ###(a+b)combination a!
    a=min(a,b)
    b=max(a,b)
    c=1
    d=1
    if a>0 and b>=0:
        for i in range(a):
            c*=(a+b-i)
            c=c%mod
            d*=(i+1)
            d=d%mod
        print((c*pow(d,mod-2,mod))%mod)
    elif a==0 and b>0:
        for i in range(b):
            c*=(b-i)
            c=c%mod
        print(c)
    else:
        print("0")

Fixed submission:
X,Y=map(int,input().split())
mod=10**9+7
"""2a+b=X 2b+a=Yを満たすabの並び替え"""
###a+b=(X+Y)/3,a-b=X-Y
###a,b>=0 かつ X+Y(mod3)==0
if (X+Y)%3!=0:
    print("0")##immposible
else:
    a=min(((X+Y)//3+(X-Y))//2,((X+Y)//3-(X-Y))//2)
    b=max(((X+Y)//3+(X-Y))//2,((X+Y)//3-(X-Y))//2)
    ###(a+b)combination a
    c=1
    d=1
    if a>0 and b>=0:
        for i in range(a):
            c*=(a+b-i)
            c=c%mod
            d*=(i+1)
            d=d%mod
        print((c*pow(d,mod-2,mod))%mod)
    elif a==0 and b>0:
        print("1")
    else:
        print("0")

Buggy python submission (verdict: Runtime Error):
X,Y=map(int,input().split())
mod=10**9+7
"""2a+b=X "2b+a=Yを満たすabの並び替え"""
###a+b=(X+Y)/3,a-b=X-Y
###a,b>=0 かつ X+Y(mod3)==0
if (X+Y)%3!=0:
    print("0")##immposible
else:
    a=((X+Y)//3+(X-Y))/2
    b=((X+Y)//3-(X-Y))/2
    ###(a+b)combination a!
    a=min(a,b)
    b=max(a,b)
    c=1
    d=1
    if a>0 and b>=0:
        for i in range(a):
            c*=(a+b-i)
            c=c%mod
            d*=(i+1)
            d=d%mod
        print((c*pow(d,mod-2,mod))%mod)
    elif a==0 and b>0:
        for i in range(b):
            c*=(b-i)
            c=c%mod
            print(c)
    else:
        print("0")

Fixed submission:
X,Y=map(int,input().split())
mod=10**9+7
"""2a+b=X 2b+a=Yを満たすabの並び替え"""
###a+b=(X+Y)/3,a-b=X-Y
###a,b>=0 かつ X+Y(mod3)==0
if (X+Y)%3!=0:
    print("0")##immposible
else:
    a=min(((X+Y)//3+(X-Y))//2,((X+Y)//3-(X-Y))//2)
    b=max(((X+Y)//3+(X-Y))//2,((X+Y)//3-(X-Y))//2)
    ###(a+b)combination a
    c=1
    d=1
    if a>0 and b>=0:
        for i in range(a):
            c*=(a+b-i)
            c=c%mod
            d*=(i+1)
            d=d%mod
        print((c*pow(d,mod-2,mod))%mod)
    elif a==0 and b>0:
        print("1")
    else:
        print("0")
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
ans=1
for i in range(1,n+1):
    ans*=i
  
print(ans%(10**9+7))


Fixed submission:
n=int(input())
ans=1
for i in range(1,n+1):
    ans=(ans*i)%(10**9+7)
  
print(ans%(10**9+7))
Buggy python submission (verdict: Runtime Error):
a=input()
b=input()
h=input()
ans = (a+b)*h/2
print(ans)


Fixed submission:
a=int(input())
b=int(input())
h=int(input())
ans =  (a+b)*h//2
print(ans)

Buggy python submission (verdict: Runtime Error):
ans = (a+b)*h/2
print(ans)

Fixed submission:
a=int(input())
b=int(input())
h=int(input())
ans =  (a+b)*h//2
print(ans)

Buggy python submission (verdict: Runtime Error):
(a+b)*h/2


Fixed submission:
a=int(input())
b=int(input())
h=int(input())
ans =  (a+b)*h//2
print(ans)
Buggy python submission (verdict: Runtime Error):
a= []
for i in range(3):
  a_input = input().split()
  a.append(int(a_input))

for i in range(n):
  x = input()
  for j in range(3):
    for k in range(3):
      if x == a[j][k]:
        a[j][k] = "0"

for i in range(3):
    if a[0][i] == "0" and a[0][i] == a[1][i] and a[0][i] == a[2][i]:
      print("Yes")
    elif a[i][0] == "0" and a[i][0] == a[i][1] and a[i][0] == a[i][2]:
      print("Yes")
    elif a[0][0] == "0" and a[0][0] == a[1][1] and a[1][1] == a[2][2]:
      print("Yes")
    elif a[0][2] == "0" and a[0][2] == a[1][1] and a[0][2] == a[2][0]:
      print("Yes")
    else:
      print("No")

Fixed submission:
a= []
for i in range(3):
  a_input = input().split()
  a.append(a_input)

n = int(input())
for i in range(n):
  x = input()
  for j in range(3):
    for k in range(3):
      if x == a[j][k]:
        a[j][k] = "0"

for i in range(3):
    if a[0][i] == "0" and a[0][i] == a[1][i] and a[0][i] == a[2][i]:
      print("Yes")
      exit()
    elif a[i][0] == "0" and a[i][0] == a[i][1] and a[i][0] == a[i][2]:
      print("Yes")
      exit()
    elif a[0][0] == "0" and a[0][0] == a[1][1] and a[1][1] == a[2][2]:
      print("Yes")
      exit()
    elif a[0][2] == "0" and a[0][2] == a[1][1] and a[0][2] == a[2][0]:
      print("Yes")
      exit()
print("No")

Buggy python submission (verdict: Runtime Error):
a= []
for i in range(3):
  a_input = input().split()
  a.append(int(a_input))

for i in range(n):
  x = input()
  for j in range(3):
    for k in range(3):
      if x == int(a[j][k]):
        a[j][k] = "0"

for i in range(3):
    if a[0][i] == "0" and a[0][i] == a[1][i] and a[0][i] == a[2][i]:
      print("Yes")
    elif a[i][0] == "0" and a[i][0] == a[i][1] and a[i][0] == a[i][2]:
      print("Yes")
    elif a[0][0] == "0" and a[0][0] == a[1][1] and a[1][1] == a[2][2]:
      print("Yes")
    elif a[0][2] == "0" and a[0][2] == a[1][1] and a[0][2] == a[2][0]:
      print("Yes")
    else:
      print("No")

Fixed submission:
a= []
for i in range(3):
  a_input = input().split()
  a.append(a_input)

n = int(input())
for i in range(n):
  x = input()
  for j in range(3):
    for k in range(3):
      if x == a[j][k]:
        a[j][k] = "0"

for i in range(3):
    if a[0][i] == "0" and a[0][i] == a[1][i] and a[0][i] == a[2][i]:
      print("Yes")
      exit()
    elif a[i][0] == "0" and a[i][0] == a[i][1] and a[i][0] == a[i][2]:
      print("Yes")
      exit()
    elif a[0][0] == "0" and a[0][0] == a[1][1] and a[1][1] == a[2][2]:
      print("Yes")
      exit()
    elif a[0][2] == "0" and a[0][2] == a[1][1] and a[0][2] == a[2][0]:
      print("Yes")
      exit()
print("No")
Buggy python submission (verdict: Runtime Error):
a, op, b = map(int, input().split())
print(a + b if op == + else a - b)

Fixed submission:
a, op, b = map(str, input().split())
a = int(a)
b = int(b)
print(a + b if op == "+" else a - b)

Buggy python submission (verdict: Runtime Error):
a, b, c = map(str, input().split())
a = int(a)
b = int(b)
print(a + b if op == "+" else a - b)

Fixed submission:
a, op, b = map(str, input().split())
a = int(a)
b = int(b)
print(a + b if op == "+" else a - b)

Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
print(a + b if op == + else a - b)

Fixed submission:
a, op, b = map(str, input().split())
a = int(a)
b = int(b)
print(a + b if op == "+" else a - b)

Buggy python submission (verdict: Runtime Error):
a = int(input())
op = str(input())
b = int(input())
print(a + b if op == "+" else a - b)

Fixed submission:
a, op, b = map(str, input().split())
a = int(a)
b = int(b)
print(a + b if op == "+" else a - b)

Buggy python submission (verdict: Runtime Error):
a = int(input())
op = input()
b = int(input())
print(a + b if op == "+" else a - b)

Fixed submission:
a, op, b = map(str, input().split())
a = int(a)
b = int(b)
print(a + b if op == "+" else a - b)