qyliang/CodeNanoFix huggingface dataset:
Buggy code:
A=[]
for i in range(0,3):
    k=list(map(int,input().split(' ')))
    A.append(k)
n=int(input())
b=[]
for i in range(0,n+1):
    b.append(int(input()))
for i in range(0,2):
    if (A[1][i] and A[2][i] and A[0][i]) in b:
        print('Yes')
        quit()
    if (A[i][1] and A[i][2] and A[i][0]) in b:
        print('Yes')
        quit()
if (A[0][0] and A[2][2] and A[1][1]) in b:
    print('Yes')
    quit()
if (A[0][2] and A[2][0] and A[1][1]) in b:
    print('Yes')
    quit()
print('No')

Fixed code:
A=[]
for i in range(0,3):
    k=list(map(int,input().split(' ')))
    A.append(k)
n=int(input())
b=[]
for i in range(0,n):
    b.append(int(input()))
for i in range(0,3):
    if (A[1][i] in b and A[2][i] in b and A[0][i] in b):
        print('Yes')
        quit()
    if (A[i][1] in b and A[i][2] in b and A[i][0] in b):
        print('Yes')
        quit()
if (A[0][0] in b and A[2][2] in b and A[1][1] in b):
    print('Yes')
    quit()
if (A[0][2] in b and A[2][0] in b and A[1][1] in b):
    print('Yes')
    quit()
print('No')
Buggy code:
import itertools

A = []
A1 = [int(i) for i in input().split()]
A.append(A1)
A2 = [int(i) for i in input().split()]
A.append(A2)
A3 = [int(i) for i in input().split()]
A.append(A3)

f = [[0] * 3 for i in range(3)]

#print(A)


N = int(input ())
b = [input().split() for i in range(N)]
b= list(itertools.chain.from_iterable(b))
b = list(map(int, b))
print(b)

for i in range(3):
    for j in range(3):
        for x in b:
            if A[i][j] == x:
                f[i][j] = 1
s = 0

for i in range(3):
    if sum(f[i]) == 3:
        s = 1
    if f[0][0] + f[1][1] + f[2][2] == 3:
        s = 1
    if f[0][2] + f[1][1] + f[2][0] == 3:
        s = 1
    for j in range(3):
        if f[0][j] + f[1][j] + f[2][j] == 3:
            s = 1
        
                
        
if s == 1:
    print("Yes")
else:
    print("No")




Fixed code:
import itertools

A = []
A1 = [int(i) for i in input().split()]
A.append(A1)
A2 = [int(i) for i in input().split()]
A.append(A2)
A3 = [int(i) for i in input().split()]
A.append(A3)

f = [[0] * 3 for i in range(3)]

#print(A)


N = int(input ())
b = [input().split() for i in range(N)]
b= list(itertools.chain.from_iterable(b))
b = list(map(int, b))

for i in range(3):
    for j in range(3):
        for x in b:
            if A[i][j] == x:
                f[i][j] = 1
s = 0

for i in range(3):
    if sum(f[i]) == 3:
        s = 1
    if f[0][0] + f[1][1] + f[2][2] == 3:
        s = 1
    if f[0][2] + f[1][1] + f[2][0] == 3:
        s = 1
    for j in range(3):
        if f[0][j] + f[1][j] + f[2][j] == 3:
            s = 1
        
                
        
if s == 1:
    print("Yes")
else:
    print("No")
Buggy code:
A = [list(map(int, input().split())) for i in range(3)]
N = int(input())
b = []
for i in range(N):
    b.append(int(input()))
x = False
for i in range(3):
    count = 0
    for j in range(3):
        for k in range(N):
            if A[i][j] == b[k]:
                count += 1
    if count == 3:
        x = True
        break
if not x:
    for i in range(3):
        count = 0
        for j in range(3):
            for k in range(N):
                if A[j][i] == b[k]:
                    count += 1
        if count == 3:
            x = True
            break
if not x:
    count = 0
    for i in range(3):
        for k in range(N):

            if A[i][i] == b[k]:
                count += 1
    if count == 3:
        x = True
if not x:
    count = 0
    for i in range(3):
        for k in range(N):
            if A[2-i][i] == b[k]:
                count += 1
    if count == 3:
        x = True

if x:
    print("YES")
else:
    print("NO")








Fixed code:
A = [list(map(int, input().split())) for i in range(3)]
N = int(input())
b = []
for i in range(N):
    b.append(int(input()))
x = False
for i in range(3):
    count = 0
    for j in range(3):
        for k in range(N):
            if A[i][j] == b[k]:
                count += 1
    if count == 3:
        x = True
        break
if not x:
    for i in range(3):
        count = 0
        for j in range(3):
            for k in range(N):
                if A[j][i] == b[k]:
                    count += 1
        if count == 3:
            x = True
            break
if not x:
    count = 0
    for i in range(3):
        for k in range(N):

            if A[i][i] == b[k]:
                count += 1
    if count == 3:
        x = True
if not x:
    count = 0
    for i in range(3):
        for k in range(N):
            if A[2-i][i] == b[k]:
                count += 1
    if count == 3:
        x = True

if x:
    print("Yes")
else:
    print("No")
Buggy code:
import numpy as np

a1,a2,a3 = map(int,input().split())
a4,a5,a6 = map(int,input().split())
a7,a8,a9 = map(int,input().split())

a = np.array([[a1, a2, a3], [a4, a5, a6], [a7, a8, a9]])

n = int(input)
for i in range(n):
  b = int(input())
  a[a = b] = 0

if np.sum(a[1,:]) = 0:
  print("Yes")
elif  np.sum(a[2,:]) = 0:
  print("Yes")
elif  np.sum(a[3,:]) = 0:
  print("Yes")
elif  np.sum(a[:,1]) = 0:
  print("Yes")
elif  np.sum(a[:,2]) = 0:
  print("Yes")
elif  np.sum(a[:,3]) = 0:
  print("Yes")
elif a[1,1] + a[2,2] + a[3,3] = 0:
  print("Yes")
elif a[3,1] + a[2,2] + a[1,3] = 0:
  print("Yes")
else:
  print("No")


Fixed code:
import numpy as np

a1,a2,a3 = map(int,input().split())
a4,a5,a6 = map(int,input().split())
a7,a8,a9 = map(int,input().split())

a = np.array([[a1, a2, a3], [a4, a5, a6], [a7, a8, a9]])

n = int(input())
for i in range(n):
  b = int(input())
  a = np.where(a == b, 0, a)

if a[0,0] + a[0,1] + a[0,2] == 0:
  print("Yes")
elif a[1,0] + a[1,1] + a[1,2] == 0:
  print("Yes")
elif a[2,0] + a[2,1] + a[2,2] == 0:
  print("Yes")
elif a[0,0] + a[1,0] + a[2,0] == 0:
  print("Yes")
elif a[0,1] + a[1,1] + a[2,1] == 0:
  print("Yes")
elif a[0,2] + a[1,2] + a[2,2] == 0:
  print("Yes")
elif a[0,0] + a[1,1] + a[2,2] == 0:
  print("Yes")
elif a[2,0] + a[1,1] + a[0,2] == 0:
  print("Yes")
else:
  print("No")
Buggy code:
A=[[int(i) for i in input().split()] for _ in range(3)]
N=int(input())
for _ in range(N):
    b=int(input())
    for i in range(3):
        for j in range(3):
            if A[i][j]==b:
                A[i][j]=-1
flag=False
for h in range(3):
    cnt=0
    for w in range(3):
        if A[h][w]==-1:
            cnt+=1
    if cnt==3:
        flag=True
for w in range(3):
    cnt=0
    for h in range(3):
        if A[h][w]==-1:
            cnt+=1
    if cnt==3:
        flag=True
cnt=0
if A[d][d]==-1:
    cnt+=1
if cnt==3:
    flag=True
cnt=0
if A[d][-d]==-1:
    cnt+=1
if cnt==3:
    flag=True
print('Yes' if flag else 'No')


Fixed code:
A=[[int(i) for i in input().split()] for _ in range(3)]
N=int(input())
for _ in range(N):
    b=int(input())
    for i in range(3):
        for j in range(3):
            if A[i][j]==b:
                A[i][j]=-1
flag=False
for h in range(3):
    cnt=0
    for w in range(3):
        if A[h][w]==-1:
            cnt+=1
    if cnt==3:
        flag=True
for w in range(3):
    cnt=0
    for h in range(3):
        if A[h][w]==-1:
            cnt+=1
    if cnt==3:
        flag=True
cnt=0
for d in range(3):
    if A[d][d]==-1:
        cnt+=1
if cnt==3:
    flag=True
cnt=0
for d in range(3):
    if A[d][2-d]==-1:
        cnt+=1
if cnt==3:
    flag=True
print('Yes' if flag else 'No')
Buggy code:
a1 = list(map(int,input().split()))
a2 = list(map(int,input().split()))
a3 = list(map(int,input().split()))
n = int(input())
b=[int(input()) for i in range(n)]

aa = []
aa.append(a1)
aa.append(a2)
aa.append(a3)

a = aa[:]
for _ in range(n):
  for i in range(3):
    for j in range(3):
      if aa[i][j] == b[_]:
        a[i][j] = 0

if a[0][0] == a[0][1] and a[0][1] == a[0][2] :
  print("Yes")
if a[1][0] == a[1][1] and a[1][1] == a[1][2] :
  print("Yes")
if a[2][0] == a[2][1] and a[2][1] == a[2][2] :
  print("Yes")
elif a[0][0] == a[1][0] and a[1][0] == a[2][0]:
  print("Yes")
elif a[0][1] == a[1][1] and a[1][1] == a[2][1]:
  print("Yes")
elif a[0][2] == a[1][0] and a[1][2] == a[2][2]:
  print("Yes")
elif a[0][0] == a[1][1] and a[1][1] == a[2][2]:
  print("Yes")
elif a[0][2] == a[1][1] and a[1][1] == a[2][0]:
  print("Yes")
else:
  print("No")


Fixed code:
a1 = list(map(int,input().split()))
a2 = list(map(int,input().split()))
a3 = list(map(int,input().split()))
n = int(input())
b=[int(input()) for i in range(n)]

aa = []
aa.append(a1)
aa.append(a2)
aa.append(a3)

a = aa[:]
for _ in range(n):
  for i in range(3):
    for j in range(3):
      if aa[i][j] == b[_]:
        a[i][j] = 0

if a[0][0] == a[0][1] and a[0][1] == a[0][2] :
  print("Yes")
elif a[1][0] == a[1][1] and a[1][1] == a[1][2] :
  print("Yes")
elif a[2][0] == a[2][1] and a[2][1] == a[2][2] :
  print("Yes")
elif a[0][0] == a[1][0] and a[1][0] == a[2][0]:
  print("Yes")
elif a[0][1] == a[1][1] and a[1][1] == a[2][1]:
  print("Yes")
elif a[0][2] == a[1][2] and a[1][2] == a[2][2]:
  print("Yes")
elif a[0][0] == a[1][1] and a[1][1] == a[2][2]:
  print("Yes")
elif a[0][2] == a[1][1] and a[1][1] == a[2][0]:
  print("Yes")
else:
  print("No")
Buggy code:
def main():
    A = [list(map(int, input().split())) for i in range(3)]
    N = int(input())
    b = [int(i) for i in range(N)]
    
    for i in range(3):
        for j in range(3):
            for k in range(N):
                if (A[i,j] == b(k)):
                    A[i,j] = 0
    
    ans = "No"
    for i in range(3):
        if A[i,0]==A[i,1]==A[i,2]==0: ans = "Yes"
        if A[0,i]==A[1,i]==A[2,i]==0: ans = "Yes"
    if A[0,0]==A[1,1]==A[2,2]==0: ans = "Yes"
    if A[0,2]==A[1,1]==A[2,0]==0: ans = "Yes"
    print(ans)
main()

Fixed code:
def main():
    A = [list(map(int, input().split())) for i in range(3)]
    N = int(input())
    b = [int(input()) for i in range(N)]
    
    for i in range(3):
        for j in range(3):
            for k in range(N):
                if A[i][j] == b[k]:
                    A[i][j] = 0
    
    ans = "No"
    for i in range(3):
        if A[i][0]+A[i][1]+A[i][2]==0:
            ans = "Yes"
        if A[0][i]+A[1][i]+A[2][i]==0:
            ans = "Yes"
    if A[0][0]+A[1][1]+A[2][2]==0:
        ans = "Yes"
    if A[0][2]+A[1][1]+A[2][0]==0:
        ans = "Yes"
    print(ans)
main()
Buggy code:
R = 3
r = []
for i in range(R):
  r[i] = list(map(int, input().split(' ')))

def check():
  for y in range(R):
    f = True
    for x in range(R):
      if r[y][x] != 0:
        f = False
    if f:
      return True

  for x in range(R):
    f = True
    for y in range(R):
      if r[y][x] != 0:
        f = False
    if f:
      return True

  f = True
  for p in range(R):
    if r[p][p] != 0:
	    f = False
  if f:
    return True

  f = True
  for p in range(R):
    if r[R-1-p][p] != 0:
	    f = False
  return f

N = input()
for i in range(N):
  v = int(input())
  
  for y in range(R):
    for x in range(R):
      if r[y][x] == v:
        r[y][x] = 0

print('Yes' if check() else 'No')


Fixed code:
R = 3
r = [ list(map(int, input().split(' '))) for i in range(R) ]

def check():
  for y in range(R):
    f = True
    for x in range(R):
      if r[y][x] != 0:
        f = False
        break
    if f:
      return True
 
  for x in range(R):
    f = True
    for y in range(R):
      if r[y][x] != 0:
        f = False
        break
    if f:
      return True
 
  f = True
  for p in range(R):
    if r[p][p] != 0:
      f = False
      break
  if f:
    return True
 
  f = True
  for p in range(R):
    if r[R-1-p][p] != 0:
      f = False
      break
  return f
 
N = int(input())
for i in range(N):
  v = int(input())
  
  for y in range(R):
    for x in range(R):
      if r[y][x] == v:
        r[y][x] = 0
 
print('Yes' if check() else 'No')
Buggy code:
A = [list(map(int, input().split())) for _ in range(3)]

N = int(input())
B = [int(input()) for _ in range(N)]

a = []

Atf = [[False] * 3 for _ in range(3)]

for i in range(3):
    for aa in A[i]:
        a.append(aa)

for b in B:
    if b in a:
        for i in range(3):
            for j in range(3):
                if A[i][j] == b:
                    Atf[i][j] = True

res = False

for i in range(3):
    if Atf[i][0] and Atf[i][1] and Atf[i][2]:
        res = True
        break
    elif A[0][i] and A[1][i] and A[2][i]:
        res = True
        break

if not res:
    if Atf[0][0] and Atf[1][1] and Atf[2][2]:
        res = True
    elif Atf[0][2] and Atf[1][1] and Atf[2][0]:
        res = True
 

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

Fixed code:
A = [list(map(int, input().split())) for _ in range(3)]

N = int(input())
B = [int(input()) for _ in range(N)]

a = []

Atf = [[False] * 3 for _ in range(3)]

for i in range(3):
    for aa in A[i]:
        a.append(aa)

for b in B:
    if b in a:
        for i in range(3):
            for j in range(3):
                if A[i][j] == b:
                    Atf[i][j] = True

res = False

for i in range(3):
    if Atf[i][0] and Atf[i][1] and Atf[i][2]:
        res = True
        break
    elif Atf[0][i] and Atf[1][i] and Atf[2][i]:
        res = True
        break

if not res:
    if Atf[0][0] and Atf[1][1] and Atf[2][2]:
        res = True
    elif Atf[0][2] and Atf[1][1] and Atf[2][0]:
        res = True
 

if res:
    print("Yes")
else:
    print("No")
Buggy code:
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
X = A + B + C
N = int(input())
L = []
for i in range (N):
  K = int(input())
  L.append(K)
ck = 'No'
if A[1] in L and A[2]in L and A[3] in L:
  ck == 'Yes'
elif B[1] in L and B[2]in L and B[3] in L:
  ck == 'Yes'
elif C[1] in L and C[2]in L and C[3] in L:
  ck == 'Yes'
elif A[1] in L and B[1]in L and C[1] in L:
  ck == 'Yes'
elif A[2] in L and B[2]in L and C[2] in L:
  ck == 'Yes'
elif A[3] in L and B[3]in L and C[3] in L:
  ck == 'Yes'
elif A[1] in L and B[2] in L and C[3] in L:
  ck = 'Yes'
elif A[3] in L and B[2] in L and C[1] in L:
  ck = 'Yes'
print(ck)

Fixed code:
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
X = A + B + C
N = int(input())
L = []
for i in range (N):
  K = int(input())
  L.append(K)
ck = 'No'
if A[0] in L and A[1]in L and A[2] in L:
  ck = 'Yes'
elif B[0] in L and B[1]in L and B[2] in L:
  ck = 'Yes'
elif C[0] in L and C[1]in L and C[2] in L:
  ck = 'Yes'
elif A[0] in L and B[0]in L and C[0] in L:
  ck = 'Yes'
elif A[1] in L and B[1]in L and C[1] in L:
  ck = 'Yes'
elif A[2] in L and B[2]in L and C[2] in L:
  ck = 'Yes'
elif A[0] in L and B[1] in L and C[2] in L:
  ck = 'Yes'
elif A[2] in L and B[1] in L and C[0] in L:
  ck = 'Yes'
print(ck)
Buggy code:
A1 = list(map(int, input().split()))
A2 = list(map(int, input().split()))
A3 = list(map(int, input().split()))
A = [A1,A2,A3]
bingomap = [[0,0,0],[0,0,0],[0,0,0]]
print(A)
N = int(input())
b = list()
ret = 'No'
for i in range(N):
  b.append(int(input()))
  print(b)
  for i in range(N):
    for j in range(3):
      if b[i] in A[j]:
        bingomap[j][A[j].index(b[i])] = 1
        break
    if i >= 2 :
      if checkbingo(bingomap) == True:
        ret = 'Yes'
        break
print(ret)

def checkbingo(map_):
  for i in range(3):
    if map_[i][0] * map_[i][1] * map_[i][2] == 1:
      return True
    if map_[0][i] * map_[0][i] * map_[0][i] == 1:
      return True
  if map_[0][0] * map_[1][1] * map_[2][2] == 1:
    return True
  if map_[0][2] * map_[1][1] * map_[2][0] == 1:
    return True
  return False 

Fixed code:
def checkbingo(map_):
  for i in range(3):
    if map_[i][0] * map_[i][1] * map_[i][2] == 1:
      return True
    if map_[0][i] * map_[1][i] * map_[2][i] == 1:
      return True
  if map_[0][0] * map_[1][1] * map_[2][2] == 1:
    return True
  if map_[0][2] * map_[1][1] * map_[2][0] == 1:
    return True
  return False 

A1 = list(map(int, input().split()))
A2 = list(map(int, input().split()))
A3 = list(map(int, input().split()))
A = [A1,A2,A3]
bingomap = [[0,0,0],[0,0,0],[0,0,0]]
N = int(input())
b = list()
ret = 'No'
for i in range(N):
  b.append(int(input()))
for i in range(N):
  for j in range(3):
    if b[i] in A[j]:
      bingomap[j][A[j].index(b[i])] = 1
      break
  if i >= 2 :
    if checkbingo(bingomap) == True:
      ret = 'Yes'
      break
print(ret)
Buggy code:
A = [list(map(int,input().split(" "))) for i in range(3)]
N = int(input())
b = list(map(int(input())))
import numpy as np
A = np.array(A)
l = []
for i in range(N):
  if b[i] in A:
    l.append(tuple(nd[0] for nd in np.where(A == b[i])))
if (0, 0) in l and (1, 0) in l and (2, 0) in l:
  print("Yes")
elif (0, 0) in l and (1, 1) in l and (2, 2) in l:
  print("Yes")
elif (0, 1) in l and (1, 1) in l and (2, 1) in l:
  print("Yes")
elif (0, 2) in l and (1, 1) in l and (2, 0) in l:
  print("Yes")
elif (0, 2) in l and (1, 2) in l and (2, 2) in l:
  print("Yes")
elif (0, 0) in l and (0, 1) in l and (0, 2) in l:
  print("Yes")
elif (1, 0) in l and (1, 1) in l and (1, 2) in l:
  print("Yes")
elif (2, 0) in l and (2, 1) in l and (2, 2) in l:
  print("Yes")
else:
  print("No")

Fixed code:
A = [list(map(int,input().split())) for _ in range(3)]
N = int(input())
b = [int(input()) for i in range(N)]
    
import numpy as np
A = np.array(A)
l = []
for i in range(N):
  if b[i] in A:
    l.append(tuple(nd[0] for nd in np.where(A == b[i])))
if (0, 0) in l and (1, 0) in l and (2, 0) in l:
  print("Yes")
elif (0, 0) in l and (1, 1) in l and (2, 2) in l:
  print("Yes")
elif (0, 1) in l and (1, 1) in l and (2, 1) in l:
  print("Yes")
elif (0, 2) in l and (1, 1) in l and (2, 0) in l:
  print("Yes")
elif (0, 2) in l and (1, 2) in l and (2, 2) in l:
  print("Yes")
elif (0, 0) in l and (0, 1) in l and (0, 2) in l:
  print("Yes")
elif (1, 0) in l and (1, 1) in l and (1, 2) in l:
  print("Yes")
elif (2, 0) in l and (2, 1) in l and (2, 2) in l:
  print("Yes")
else:
  print("No")
Buggy code:
a=[list(map(int,input().split())) for _ in [0]*3]
n=int(input())
b=[int(input()) for _ in range(n)]

import numpy as np

for i in range(3):
  a[i]=[1 if x in b else 0 for x in a[i]]   

s_1=max(np.sum(a,axis=0))
s_2=max(np.sum(a,axis=1))
s_3=a[0][0]+a[1][1]+a[2][2]
s_4=a[0][2]+a[1][1]+a[2][0]

if max(s_1,s_2,s_3,s_4)==3:
  print("Yes")
else:
  print("No")
print(a)

Fixed code:
a=[list(map(int,input().split())) for _ in [0]*3]
n=int(input())
b=[int(input()) for _ in range(n)]

import numpy as np

for i in range(3):
  a[i]=[1 if x in b else 0 for x in a[i]]   

s_1=max(np.sum(a,axis=0))
s_2=max(np.sum(a,axis=1))
s_3=a[0][0]+a[1][1]+a[2][2]
s_4=a[0][2]+a[1][1]+a[2][0]

if max(s_1,s_2,s_3,s_4)==3:
  print("Yes")
else:
  print("No")
Buggy code:
a = [input().split() for i in range(3)]
n = int(input())
b = [int(input()) for i in range(n)]
total = []
s = 0
 
for i in range(n):
  for k in range(3):
    for j in range(3):
      if b[i] == int(a[k][j]):
        total.append(s + j)
    s = s + 3
if ((0 and 1 and 2) in total) or ((3 and 4 and 5) in total) or ((6 and 7 and 8) in total) or ((0 and 3 and 6) in total) or ((1 and 4 and 7) in total) or ((2 and 5 and 8) in total) or ((0 and 4 and 8) in total) or ((2 and 4 and 6) in total):
  print("Yes")
else:
  print("No")

Fixed code:
a = [input().split() for i in range(3)]
n = int(input())
b = [int(input()) for i in range(n)]
total = []
 
for i in range(n):
  for k in range(3):
    for j in range(3):
      if b[i] == int(a[k][j]):
          total.append(k * 3 + j)
          
if 0 in total and 1 in total and 2 in total: 
  print("Yes")
elif 3 in total and 4 in total and 5 in total: 
  print("Yes")
elif 6 in total and 7 in total and 8 in total: 
  print("Yes")
elif 0 in total and 3 in total and 6 in total: 
  print("Yes")
elif 1 in total and 4 in total and 7 in total: 
  print("Yes")
elif 2 in total and 5 in total and 8 in total: 
  print("Yes")
elif 0 in total and 4 in total and 8 in total: 
  print("Yes")
elif 2 in total and 4 in total and 6 in total: 
  print("Yes")
else:
  print("No")
Buggy code:
a11,a12,a13=(int(x) for x in input().split())
a21,a22,a23=(int(x) for x in input().split())
a31,a32,a33=(int(x) for x in input().split())
n=int(input())
list=[]
for i in range(n):
	list.append(int(input()))
s=set(list)

def ch(a,b,c,s):
	print(a,b,c,s)
	k=0
	if a in s:
		if b in s:
			if c in s:
				k=1
	return k
co=0
co+=ch(a11,a12,a13,s)
co+=ch(a21,a22,a23,s)
co+=ch(a31,a32,a33,s)
co+=ch(a11,a21,a31,s)
co+=ch(a12,a22,a32,s)
co+=ch(a13,a23,a33,s)
co+=ch(a11,a22,a33,s)
co+=ch(a13,a22,a31,s)
if co>0:
	print("Yes")
else:
	print("No")


Fixed code:
a11,a12,a13=(int(x) for x in input().split())
a21,a22,a23=(int(x) for x in input().split())
a31,a32,a33=(int(x) for x in input().split())
n=int(input())
list=[]
for i in range(n):
	list.append(int(input()))
s=set(list)

def ch(a,b,c,s):
	k=0
	if a in s:
		if b in s:
			if c in s:
				k=1
	return k
co=0
co+=ch(a11,a12,a13,s)
co+=ch(a21,a22,a23,s)
co+=ch(a31,a32,a33,s)
co+=ch(a11,a21,a31,s)
co+=ch(a12,a22,a32,s)
co+=ch(a13,a23,a33,s)
co+=ch(a11,a22,a33,s)
co+=ch(a13,a22,a31,s)
if co>0:
	print("Yes")
else:
	print("No")
Buggy code:
#B
a = [list(map(int, input().split())) for _ in range(3)]
n = int(input())
for i in range(n):
    m = int(input())
    for j in range(3):
        for k in range(3):
            if a[j][k] == m:
                a[j][k] = 0
f = False
print(a)
for j in range(3):
    if a[j][0] == 0 and a[j][1] == 0 and a[j][2] == 0:
        f = True
    if a[0][j] == 0 and a[1][j] == 0 and a[2][j] == 0:
        f = True
if (a[0][0] == 0 and a[1][1] == 0 and a[2][2] == 0) or (a[2][0] == 0 and a[1][1] == 0 and a[0][2] == 0):
    f = True
if f:
    print('Yes')
else:
    print('No')

Fixed code:
#B
a = [list(map(int, input().split())) for _ in range(3)]
n = int(input())
for i in range(n):
    m = int(input())
    for j in range(3):
        for k in range(3):
            if a[j][k] == m:
                a[j][k] = 0
f = False
for j in range(3):
    if a[j][0] == 0 and a[j][1] == 0 and a[j][2] == 0:
        f = True
    if a[0][j] == 0 and a[1][j] == 0 and a[2][j] == 0:
        f = True
if (a[0][0] == 0 and a[1][1] == 0 and a[2][2] == 0) or (a[2][0] == 0 and a[1][1] == 0 and a[0][2] == 0):
    f = True
if f:
    print('Yes')
else:
    print('No')
Buggy code:
A = [[0 for i in range(3)]for i2 in range(3)]
c = [[False for i in range(3)]for i2 in range(3)]
A[0] = list(map(int,input().rstrip().split(" ")))
A[1] = list(map(int,input().rstrip().split(" ")))
A[2] = list(map(int,input().rstrip().split(" ")))
int_inp = int(input())
s = 0
for i in range(int_inp):
  s = int(input())
  for i2 in range(9):
    for A[int(i2 / 3)][i2 % 3] == s:
      c[int(i2 / 3)][i2 % 3] == True
ans = False
for i in range(3):
  if c[i][0] and c[i][1] and c[i][2]:ans = True
for i in range(3):
  if c[0][i] and c[1][i] and c[2][i]:ans = True
if c[0][0] and c[1][1] and c[2][2]:ans = True
if c[2][0] and c[1][1] and c[0][2]:ans = True
if ans:
  print('Yes')
else:
  print('No')

Fixed code:
A = [[0 for i in range(3)]for i2 in range(3)]
c = [[False for i in range(3)]for i2 in range(3)]
A[0] = list(map(int,input().rstrip().split(" ")))
A[1] = list(map(int,input().rstrip().split(" ")))
A[2] = list(map(int,input().rstrip().split(" ")))
int_inp = int(input())
s = 0
for i in range(int_inp):
  s = int(input())
  for i2 in range(9):
    if A[int(i2 / 3)][i2 % 3] == s:
      c[int(i2 / 3)][i2 % 3] = True
ans = False
for i in range(3):
  if c[i][0] and c[i][1] and c[i][2]:ans = True
for i in range(3):
  if c[0][i] and c[1][i] and c[2][i]:ans = True
if c[0][0] and c[1][1] and c[2][2]:ans = True
if c[2][0] and c[1][1] and c[0][2]:ans = True
if ans:
  print('Yes')
else:
  print('No')