qyliang/CodeNanoFix huggingface dataset:
Buggy code:
import numpy as np
A = np.zeros((3,3), dtype=int)
for i in range(3):
    A[i,:] = list(map(int, input().split()))
N = int(input())
B = [int(input()) for _ in range(N)]

A = A.flatten()
for a in range(len(A)):

    for b in range(N):
        if A[a] == B[b]:
            A[a] = -1

print(A.reshape(3,3))

if A[0] == -1 and A[1] == -1 and A[2] == -1:
    print('Yes')
elif A[3] == -1 and A[4] == -1 and A[5] == -1:
    print('Yes')
elif A[6] == -1 and A[7] == -1 and A[8] == -1:
    print('Yes')
elif A[0] == -1 and A[3] == -1 and A[6] == -1:
    print('Yes')
elif A[1] == -1 and A[4] == -1 and A[6] == -1:
    print('Yes')
elif A[2] == -1 and A[5] == -1 and A[8] == -1:
    print('Yes')
elif A[0] == -1 and A[4] == -1 and A[8] == -1:
    print('Yes')
elif A[2] == -1 and A[4] == -1 and A[6] == -1:
    print('Yes')
else:
    print('No')



Fixed code:
import numpy as np
A = np.zeros((3,3), dtype=int)
for i in range(3):
    A[i,:] = list(map(int, input().split()))
N = int(input())
B = [int(input()) for _ in range(N)]

A = A.flatten()
for a in range(len(A)):

    for b in range(N):
        if A[a] == B[b]:
            A[a] = -1



if A[0] == -1 and A[1] == -1 and A[2] == -1:
    print('Yes')
elif A[3] == -1 and A[4] == -1 and A[5] == -1:
    print('Yes')
elif A[6] == -1 and A[7] == -1 and A[8] == -1:
    print('Yes')
elif A[0] == -1 and A[3] == -1 and A[6] == -1:
    print('Yes')
elif A[1] == -1 and A[4] == -1 and A[6] == -1:
    print('Yes')
elif A[2] == -1 and A[5] == -1 and A[8] == -1:
    print('Yes')
elif A[0] == -1 and A[4] == -1 and A[8] == -1:
    print('Yes')
elif A[2] == -1 and A[4] == -1 and A[6] == -1:
    print('Yes')
else:
    print('No')
Buggy code:
A=[]
flag=0
for i in range(3):
  A.append(list(map(int,input().split())))
n=int(input())
for i in range(n):
  s=int(input())
  for k in range(3):
    if s in A[k]:
      A[k][A[k].index(s)]=0

if A[0]==[0,0,0] or A[1]==[0,0,0] or A[2]==[0,0,0]:
  print("Yes")
  flag=1
elif A[1][1]==0 and A[2][2]==0 and A[0][0]==0:
  print("Yes")
  flag=1
elif A[0][2]==0 and A[1][1]==0 and A[2][0]==0:
  print("Yes")
  flag=1
else:
  for i in range(3):
    if A[0][i]==0 and A[1][i]==0 and A[2][i]==0:
      print("Yes")
      flag=1
      break
if flag == 0:
  print("No")
print(A)

Fixed code:
A=[]
flag=0
for i in range(3):
  A.append(list(map(int,input().split())))
n=int(input())
for i in range(n):
  s=int(input())
  for k in range(3):
    if s in A[k]:
      A[k][A[k].index(s)]=0

if A[0]==[0,0,0] or A[1]==[0,0,0] or A[2]==[0,0,0]:
  print("Yes")
  flag=1
elif A[1][1]==0 and A[2][2]==0 and A[0][0]==0:
  print("Yes")
  flag=1
elif A[0][2]==0 and A[1][1]==0 and A[2][0]==0:
  print("Yes")
  flag=1
else:
  for i in range(3):
    if A[0][i]==0 and A[1][i]==0 and A[2][i]==0:
      print("Yes")
      flag=1
      break
if flag == 0:
  print("No")
Buggy code:
import numpy as np
card = []
for i in range(3):
  card.append(list(map(int, input().split())))
card = np.array(card)
n = int(input())
for k in range(n):
    b = int(input())
    for i in range(3):
        for j in range(3):
            if (card[i, j] == b):
                card[i, j] = 0
flag = 0
for i in range(3):
  if (sum(card[i,:]) == 0):
    flag = 1
  if (sum(card[:,i]) == 0):
    flag = 1
if (card[0,0]+card[1,1]+card[2,2] == 0):
  flag = 1
if (card[0,2]+card[1,1]+card[2,0] == 0):
  flag = 1
if (flag == 1):
  print("yes")
else:
  print("no")

Fixed code:
import numpy as np
card = []
for i in range(3):
  card.append(list(map(int, input().split())))
card = np.array(card)
n = int(input())
for k in range(n):
    b = int(input())
    for i in range(3):
        for j in range(3):
            if (card[i, j] == b):
                card[i, j] = 0
flag = 0
for i in range(3):
  if (sum(card[i,:]) == 0):
    flag = 1
  if (sum(card[:,i]) == 0):
    flag = 1
if (card[0,0]+card[1,1]+card[2,2] == 0):
  flag = 1
if (card[0,2]+card[1,1]+card[2,0] == 0):
  flag = 1
if (flag == 1):
  print("Yes")
else:
  print("No")
Buggy code:
# -*- coding: utf-8 -*-
a1 = list(map(int, input().split()))
a2 = list(map(int, input().split()))
a3 = list(map(int, input().split()))
a = [a1, a2, a3]
n = int(input())
b = []
for i in range(n):
    bn = int(input())
    b.append(bn)
for i in range(3):
    for j in range(3):
        if a[i][j] in b:
            a[i][j] = -5
print(*a)
for i in range(3):
    if sum(a[i]) == -15:
        bng = 1
for i in range(3):
     cnt = 0
     for j in range(3):
       cnt += a[j][i]
       if cnt == -15:
         bng = 1
        
cnt = 0
for i in range(3):
        cnt += a[i][i]
if cnt == -15:
        bng = 1 
                
if bng == 1:
    print("Yes")
else:
    print("No")

Fixed code:
# -*- coding: utf-8 -*-
a1 = list(map(int, input().split()))
a2 = list(map(int, input().split()))
a3 = list(map(int, input().split()))
a = [a1, a2, a3]
n = int(input())
b = []
bng = 0
for i in range(n):
    bn = int(input())
    b.append(bn)
for i in range(3):
    for j in range(3):
        if a[i][j] in b:
            a[i][j] = -5
for i in range(3):
    if sum(a[i]) == -15:
        bng = 1
for i in range(3):
     cnt = 0
     for j in range(3):
       cnt += a[j][i]
       if cnt == -15:
         bng = 1
        
cnt = 0
for i in range(3):
        cnt += a[i][i]
if cnt == -15:
        bng = 1 
if a[0][2] + a[1][1] + a[2][0] == -15:
    bng = 1
                
if bng == 1:
    print("Yes")
else:
    print("No")
Buggy code:
A = []
for _ in range(3):
    A = list(map(int, input().split()))
N = int(input())
B = [int(input()) for i in range(N)]
for i in range(N):
    for j in range(9):
        if B[i] ==  A[j] :
            A[j] = 'a'
if A[0]==A[1]==A[2]=='a' or A[3]==A[4]==A[5]=='a' or A[6]==A[7]==A[8]=='a' or A[0]==A[3]==A[6]=='a' or A[1]==A[4]==A[7]=='a' or A[2]==A[5]==A[8]=='a' or  A[0]==A[4]==A[8]=='a' or A[2]==A[4]==A[6]=='a' :
    print('Yes')
else:
    print('No')

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

for i in range(0,N):
    for j in range(9):
        if B[i] ==  A[j]:
            A[j] = 0

if A[0]==A[1]==A[2]==0 or A[3]==A[4]==A[5]==0 or A[6]==A[7]==A[8]==0 or A[0]==A[3]==A[6]==0 or A[1]==A[4]==A[7]==0 or A[2]==A[5]==A[8]==0 or  A[0]==A[4]==A[8]==0 or A[2]==A[4]==A[6]==0 :
    print('Yes')
else:
    print('No')
Buggy code:
import sys

input = sys.stdin.readline


def main():
    bingo = [list(map(int, input().split())) for _ in range(3)]
    N = int(input())
    bn = [int(input()) for _ in range(N)]
    hit = [[0] * 3 for _ in range(3)]
    cnt = 0
    hitz = []
    hzb, hb = False, False
    for b in bn:
        for v, i in enumerate(bingo):
            for w, j in enumerate(i):
                if b == j:
                    if j in hit:
                        continue
                    hit[w][v] = 1
                    cnt += 1
    hitz = list(map(list, zip(*hit)))
    for i in hitz:
        if sum(i) == 3:
            hzb = True
            break
    for i in hit:
        if sum(i) == 3:
            hb = True
            break
    print(cnt)
    if cnt >= 3 and (
        hzb == True
        or hb == True
        or hit[0][0] == hit[1][1] == hit[2][2] == 1
        or hit[0][2] == hit[1][1] == hit[2][0] == 1
    ):
        print("Yes")

    else:
        print("No")


if __name__ == "__main__":
    main()


Fixed code:
import sys

input = sys.stdin.readline


def main():
    bingo = [list(map(int, input().split())) for _ in range(3)]
    N = int(input())
    bn = [int(input()) for _ in range(N)]
    hit = [[0] * 3 for _ in range(3)]
    cnt = 0
    hitz = []
    hzb, hb = False, False
    for b in bn:
        for v, i in enumerate(bingo):
            for w, j in enumerate(i):
                if b == j:
                    if j in hit:
                        continue
                    hit[w][v] = 1
                    cnt += 1
    hitz = list(map(list, zip(*hit)))
    for i in hitz:
        if sum(i) == 3:
            hzb = True
            break
    for i in hit:
        if sum(i) == 3:
            hb = True
            break
    if cnt >= 3 and (
        hzb == True
        or hb == True
        or hit[0][0] == hit[1][1] == hit[2][2] == 1
        or hit[0][2] == hit[1][1] == hit[2][0] == 1
    ):
        print("Yes")

    else:
        print("No")


if __name__ == "__main__":
    main()
Buggy code:
a1 = list(map(int, input().split()))
a2 = list(map(int, input().split()))
a3 = list(map(int, input().split()))
n = int(input())
s = list(map(int, [input() for i in range(n)]))
l = [
  [0, 0, 0]
  , [0, 0, 0]
  , [0, 0, 0]
]
for i in range(0, 3):
  for j in range(0, n):
    if a1[i] == s[j]:
      l[0][i] = i+1
      print(a1[i])
for i in range(0, 3):
  for j in range(0, n):
    if a2[i] == s[j]:
      print(a2[i])
      l[1][i] = i+1
for i in range(0, 3):
  for j in range(0, n):
    if a3[i] == s[j]:
      print(a3[i])
      l[2][i] = i+1
n = []
for i in l:
  for j in i:
    if j != 0:
      n.append(j)
count = 0
if (1 in n) == (2 in n) == (3 in n) == True:
  count += 1
  print('Yes')
else:
  for i in range(1, 4):
    if n.count(i) == 3:
      count += 1
      print('Yes')
if count == 0:
  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())
s = list(map(int, [input() for i in range(n)]))
l = [
  [0, 0, 0]
  , [0, 0, 0]
  , [0, 0, 0]
]
for i in range(0, 3):
  for j in range(0, n):
    if a1[i] == s[j]:
      l[0][i] = i+1
for i in range(0, 3):
  for j in range(0, n):
    if a2[i] == s[j]:
      l[1][i] = i+1
for i in range(0, 3):
  for j in range(0, n):
    if a3[i] == s[j]:
      l[2][i] = i+1
n = []
for i in l:
  for j in i:
    if j != 0:
      n.append(j)
count = 0
for i in range(0, 3):
  if l[i][0] and l[i][1] and l[i][2]:
    count += 1
if (l[0][0] and l[1][1] and l[2][2]) or (l[2][0] and l[1][1] and l[0][2]):
  count += 1
else:
  for i in range(1, 4):
    if n.count(i) == 3:
      count += 1
print('Yes' if count >= 1 else 'No')
Buggy code:
#157b
a=[[int(i) for i in input().split()] for _ in range(3)]

n=int(input())
b=[int(i) for i in input().split()]
for i in range(3):
	for j in range(3):
		for e in b:
			if a[i][j]==e:
				a[i][j]=0
ans='No'
for i in range(3):
	if a[i][0]==a[i][1]==[i][2]:
		ans='Yes'
	elif a[0][i]==a[1][i]==a[2][i]:
		ans='Yes'
	elif a[0][0]==a[1][1]==a[2][2]:
		ans='Yes'
	elif a[0][2]==a[1][1]==a[2][0]:
		ans='Yes'
print(ans)

Fixed code:
#157b
a=[[int(i) for i in input().split()] for _ in range(3)]
n=int(input())
for i in range(n):
    b=int(input())
    for j in range(3):
        for k in range(3):
            if a[j][k]==b:
               a[j][k]=0
ans='No'
for i in range(3):
    if a[i][0]==a[i][1]==a[i][2]:
        ans='Yes'
    elif a[0][i]==a[1][i]==a[2][i]:
        ans='Yes'
    elif a[0][0]==a[1][1]==a[2][2]:
        ans='Yes'
    elif a[0][2]==a[1][1]==a[2][0]:
        ans='Yes'
print(ans)
Buggy code:
a = list()
for i in range(3):
    a.append([int(x) for x in input().split()])
n = int(input())
b = list()
for i in range(n):
    b.append(int(input()))
appear = [[0,0,0],[0,0,0],[0,0,0]]
for i in range(3):
    for j in range(3):
        for k in b:
            if (a[i][j] == k):
                appear[i][j] == 1

def x ():
    for i in range(3):
        if (a[i][0] and a[i][1] and a[i][2] ):
            return "Yes"
    for i in range(3):
        if (a[0][i] and a[1][i] and a[2][i]):
            return "Yes"
    if (a[0][0] and a[1][1] and a[2][2]):
        return "Yes"
    if (a[0][2] and a[1][1] and a[2][0]):
        return("Yes")
    return "No"
print(x())

Fixed code:
a = list()
for i in range(3):
    a.append([int(x) for x in input().split()])
n = int(input())
b = list()
for i in range(n):
    b.append(int(input()))
appear = [[0,0,0],[0,0,0],[0,0,0]]
for i in range(3):
    for j in range(3):
        for k in b:
            if (a[i][j] == k):
                appear[i][j] = 1

def x ():
    for i in range(3):
        if (appear[i][0] and appear[i][1] and appear[i][2] ):
            return "Yes"
    for i in range(3):
        if (appear[0][i] and appear[1][i] and appear[2][i]):
            return "Yes"
    if (appear[0][0] and appear[1][1] and appear[2][2]):
        return "Yes"
    if (appear[0][2] and appear[1][1] and appear[2][0]):
        return "Yes"
    return "No"
print(x())
Buggy code:
card = [list(map(int, input().split())) for i in range (3)]
N = int(input())
b = [int(input()) for i in range(N)]

for k in range(N):
  for i in range(3):
    for j in range(3):
      if card[i][j] == b[k]:
        card[i][j] = 0
      
print(card)

#bingo = False
for i in range(3):
  if card[i] == [0, 0, 0]:
    #bingo = True
    print("Yes")
    exit()
  elif [x[i] for x in card] == [0, 0, 0]:
    #bingo = True
    print("Yes")
    exit()
    
if [card[i][i] for i in range(3)] == [0, 0, 0]:
  #bingo = True
  print("Yes")
  exit()
elif [card[2-i][i] for i in range(3)] == [0, 0, 0]:
  #bingo = True
  print("Yes")
  exit()
else:
  #print("Yes" if bingo else "No")
  print("No")

Fixed code:
card = [list(map(int, input().split())) for i in range (3)]
N = int(input())
b = [int(input()) for i in range(N)]

for k in range(N):
  for i in range(3):
    for j in range(3):
      if card[i][j] == b[k]:
        card[i][j] = 0
      
#print(card)

#bingo = False
for i in range(3):
  if card[i] == [0, 0, 0]:
    #bingo = True
    print("Yes")
    exit()
  elif [x[i] for x in card] == [0, 0, 0]:
    #bingo = True
    print("Yes")
    exit()
    
if [card[i][i] for i in range(3)] == [0, 0, 0]:
  #bingo = True
  print("Yes")
  exit()
elif [card[2-i][i] for i in range(3)] == [0, 0, 0]:
  #bingo = True
  print("Yes")
  exit()
else:
  #print("Yes" if bingo else "No")
  print("No")
Buggy code:
A = []
for i in range(3):
    A.append(list(map(int, input().split())))

N = int(input())
b = []
for i in range(N):
    b.append(int(input()))

bingo = []
for t in range(N):
    for i in range(3):
        if b[t] in A[i]:
            j = A[i].index(b[t])
            #bingo.append((i, j))
            A[i][j] = True

for i in range(3):
    if A[i][0] == A[i][1] == A[i][2]:
        answer = "Yes"

for j in range(3):
    if A[0][j] == A[1][j] == A[2][j]:
        answer = "Yes"
if A[0][0] == A[1][1] == A[2][2]:
    answer = "Yes"

if A[2][0] == A[1][1] == A[0][2]:
    answer = "Yes"
    

print(answer)

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

N = int(input())
b = []
for i in range(N):
    b.append(int(input()))

bingo = []
for t in range(N):
    for i in range(3):
        if b[t] in A[i]:
            j = A[i].index(b[t])
            #bingo.append((i, j))
            A[i][j] = True

answer = "No"
for i in range(3):
    if A[i][0] == A[i][1] == A[i][2]:
        answer = "Yes"

for j in range(3):
    if A[0][j] == A[1][j] == A[2][j]:
        answer = "Yes"
if A[0][0] == A[1][1] == A[2][2]:
    answer = "Yes"

if A[2][0] == A[1][1] == A[0][2]:
    answer = "Yes"
    

print(answer)
Buggy code:
bingo = []
for i in range(3):
  row = [int(j) for j in input().split()]
  bingo.append(row)

ans = "No"
n = int(input())
for i in range(n):
  lot = int(input())
  for j in range(len(bingo)):
    col = 0
    for k in range(len(bingo[j])):
      if bingo[j][k] == lot:
      	bingo[j][k] = -1
      	col += bingo[j][k]
    if col == -3:
      ans = "Yes"
    if sum(bingo[k]) == -3:
  	  ans = "Yes"
    print(col)
if (bingo[0][0] + bingo[1][1] + bingo[2][2]) == -3:
  ans = "Yes"
if (bingo[0][2] + bingo[1][1] + bingo[2][0]) == -3:
  ans = "Yes"

print(ans)   

Fixed code:
bingo = []
for i in range(3):
  row = [int(j) for j in input().split()]
  bingo.append(row)
ans = "No"
n = int(input())
for i in range(n):
  lot = int(input())
  for j in range(len(bingo)):
    for k in range(len(bingo[j])):
      if bingo[j][k] == lot:
      	bingo[j][k] = -1
    if sum(bingo[j]) == -3:
  	  ans = "Yes"
if (bingo[0][0] + bingo[1][1] + bingo[2][2]) == -3:
  ans = "Yes"
if (bingo[0][2] + bingo[1][1] + bingo[2][0]) == -3:
  ans = "Yes"
if (bingo[0][0] + bingo[1][0] + bingo[2][0]) == -3:
  ans = "Yes"
if (bingo[0][1] + bingo[1][1] + bingo[2][1]) == -3:
  ans = "Yes"
if (bingo[0][2] + bingo[1][2] + bingo[2][2]) == -3:
  ans = "Yes"
print(ans)
Buggy code:
*inputs, = map(int, open(0).read().split())
A = inputs[:9]
B = inputs[9:]

C = [0] * 9
for b in B:
  if b in A:
    C[A.index(b)] = 1
    
if any([
     all(C[:3]), all(C[3:6]), all(C[6:]),
     all(C[::3]), all(C[1::3]), all(C[2::3]),
     all([C[0], C[4], C[8]]), all([C[2], C[4], C[6]])
    ]):
  print('Yes')
else:
  print('No')
print(C)

Fixed code:
*inputs, = map(int, open(0).read().split())
A = inputs[:9]
B = inputs[9:]

C = [0] * 9
for b in B:
  if b in A:
    C[A.index(b)] = 1
    
if any([
     all(C[:3]), all(C[3:6]), all(C[6:]),
     all(C[::3]), all(C[1::3]), all(C[2::3]),
     all([C[0], C[4], C[8]]), all([C[2], C[4], C[6]])
    ]):
  print('Yes')
else:
  print('No')
Buggy code:
L_yoko = [list(map(int,input().split())) for i in range(3)]

n = 9
ans = [int(input()) for _ in range(n)]

L_tate = list(zip(*L_yoko))

L_naname = []
L_naname.append([L_yoko[0][0],L_yoko[1][1],L_yoko[2][2]])
L_naname.append([L_yoko[0][2],L_yoko[1][1],L_yoko[2][0]])

a = int(0)
for z in L_tate:
    if z[0] in ans and z[1] in ans and z[2] in ans:
         a = 1
         break

for z in L_yoko:
    if z[0] in ans and z[1] in ans and z[2] in ans:
         a = 1
         break

for z in L_naname:
    if z[0] in ans and z[1] in ans and z[2] in ans:
         a = 1
         break

if a == 0:
    print("No")
else:
    print("Yes")


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


L_tate = list(zip(*L_yoko))

L_naname = []
L_naname.append([L_yoko[0][0],L_yoko[1][1],L_yoko[2][2]])
L_naname.append([L_yoko[0][2],L_yoko[1][1],L_yoko[2][0]])

n = int(input())
ans = [int(input()) for _ in range(n)]

a = int(0)
for z in L_tate:
    if z[0] in ans and z[1] in ans and z[2] in ans:
         a = 1
         break

for z in L_yoko:
    if z[0] in ans and z[1] in ans and z[2] in ans:
         a = 1
         break

for z in L_naname:
    if z[0] in ans and z[1] in ans and z[2] in ans:
         a = 1
         break


if a == 0:
    print("No")
else:
    print("Yes")
Buggy code:

A = [list(map(int, input().split())) for i in range(3)]
N = int(input())
for i in range(N):
    b = int(input())
    for j in range(3):
        for k in range(3):
            if A[j][k] == b:
                A[j][k] = 0
if A[0][0] == 0 and A[0][1] == 0 and A[0][2] == 0:
    print('yes')
elif A[1][0] == 0 and A[1][1] == 0 and A[1][2] == 0:
    print('yes')
elif A[2][0] == 0 and A[2][1] == 0 and A[2][2] == 0:
    print('yes')
elif A[0][0] == 0 and A[1][0] == 0 and A[2][0] == 0:
    print('yes')
elif A[0][1] == 0 and A[1][1] == 0 and A[2][1] == 0:
    print('yes')
elif A[0][2] == 0 and A[1][2] == 0 and A[2][2] == 0:
    print('yes')
elif A[0][0] == 0 and A[1][1] == 0 and A[2][2] == 0:
    print('yes')
elif A[0][2] == 0 and A[1][1] == 0 and A[2][0] == 0:
    print('yes')
else:
    print('No')

Fixed code:

A = [list(map(int, input().split())) for i in range(3)]
N = int(input())
for i in range(N):
    b = int(input())
    for j in range(3):
        for k in range(3):
            if A[j][k] == b:
                A[j][k] = 0
if A[0][0] == 0 and A[0][1] == 0 and A[0][2] == 0:
    print('Yes')
elif A[1][0] == 0 and A[1][1] == 0 and A[1][2] == 0:
    print('Yes')
elif A[2][0] == 0 and A[2][1] == 0 and A[2][2] == 0:
    print('Yes')
elif A[0][0] == 0 and A[1][0] == 0 and A[2][0] == 0:
    print('Yes')
elif A[0][1] == 0 and A[1][1] == 0 and A[2][1] == 0:
    print('Yes')
elif A[0][2] == 0 and A[1][2] == 0 and A[2][2] == 0:
    print('Yes')
elif A[0][0] == 0 and A[1][1] == 0 and A[2][2] == 0:
    print('Yes')
elif A[0][2] == 0 and A[1][1] == 0 and A[2][0] == 0:
    print('Yes')
else:
    print('No')
Buggy code:
Aij= [input().split() for l in range(3)]
N=int(input())
b= [int(input()) for i in range(N)]
for j in range(3):
    for k in range(3):
        for n in range(N):
            if int(Aij[j][k])==b[n]:
                Aij[j][k]='0'
if (A[0][0] == A[0][1] == A[0][2] == 0) or (A[1][0] == A[1][1] == A[1][2] == 0) or (A[2][0] == A[2][1] == A[2][2] == 0):
elif Aij[0][0]=='0' and Aij[0][1]=='0' and Aij[0][2]=='0':
    print('Yes')
elif Aij[1][0]=='0' and Aij[1][1]=='0' and Aij[1][2]=='0':
    print('Yes')
elif Aij[2][0]=='0' and Aij[2][1]=='0' and Aij[2][2]=='0':
    print('Yes')
elif Aij[0][0]=='0'and Aij[1][1]=='0'and Aij[2][2]=='0':
    print('Yes')
elif Aij[0][2]=='0' and Aij[1][1]=='0'and Aij[2][0]=='0':
    print('Yes')
else:
    print('No')

Fixed code:
Aij= [input().split() for l in range(3)]
N=int(input())
b= [int(input()) for i in range(N)]
for j in range(3):
    for k in range(3):
        for n in range(N):
            if int(Aij[j][k])==b[n]:
                Aij[j][k]='0'
if Aij[0].count('0')==3 or Aij[1].count('0')==3 or Aij[2].count('0')==3:
    print('Yes')
elif Aij[0][0]=='0' and Aij[1][0]=='0' and Aij[2][0]=='0':
    print('Yes')
elif Aij[0][1]=='0' and Aij[1][1]=='0' and Aij[2][1]=='0':
    print('Yes')
elif Aij[0][2]=='0' and Aij[1][2]=='0' and Aij[2][2]=='0':
    print('Yes')
elif Aij[0][0]=='0'and Aij[1][1]=='0'and Aij[2][2]=='0':
    print('Yes')
elif Aij[0][2]=='0' and Aij[1][1]=='0'and Aij[2][0]=='0':
    print('Yes')
else:
    print('No')
Buggy code:
import numpy as np

def check(a,b,c):
  return a==b==c==0


t=[list(map(int,list(input().split(" ")))) for i in range(3)]
n = int(input())
a = [int(input()) for _ in range(n)]

for i in a:
  for x in range(3):
    for y in range(3):
      if t[x][y] == i :
        t[x][y] = 0

ans = check(t[0][0],t[0][1],t[0][2]) or \
check(t[1][0],t[1][1],t[1][2]) or \
check(t[2][0],t[2][1],t[2][2]) or \
check(t[0][0],t[1][0],t[2][0]) or \
check(t[0][1],t[1][1],t[2][1]) or \
check(t[0][2],t[1][2],t[2][2]) or \
check(t[0][0],t[1][1],t[2][2]) or \
check(t[0][2],t[1][1],t[2][0]) 

print(ans)

Fixed code:
import numpy as np

def check(a,b,c):
  return a==b==c==0


t=[list(map(int,list(input().split(" ")))) for i in range(3)]
n = int(input())
a = [int(input()) for _ in range(n)]

for i in a:
  for x in range(3):
    for y in range(3):
      if t[x][y] == i :
        t[x][y] = 0

ans = check(t[0][0],t[0][1],t[0][2]) or \
check(t[1][0],t[1][1],t[1][2]) or \
check(t[2][0],t[2][1],t[2][2]) or \
check(t[0][0],t[1][0],t[2][0]) or \
check(t[0][1],t[1][1],t[2][1]) or \
check(t[0][2],t[1][2],t[2][2]) or \
check(t[0][0],t[1][1],t[2][2]) or \
check(t[0][2],t[1][1],t[2][0]) 

print(["No","Yes"][ans])
Buggy code:
a_list = [list(map(int, input().split())) for _ in range(3)]
n = int(input())
b_list = [int(input()) for _ in range(n)]

for y in range(3):
    for b in b_list:
        if b in a_list[y]:
            index = a_list[y].index(b)
            a_list[y][index] = -1

is_bingo = False
for y in range(3):
    if sum(a_list[y]) == -3:
        is_bingo = True
        break

for x in range(3):
    if a_list[0][x]+a_list[1][x]+a_list[2][x]:
        is_bingo = True
        break

if a_list[0][0]+a_list[1][1]+a_list[2][2] == -3:
    is_bingo = True
elif a_list[0][2]+a_list[1][1]+a_list[2][0] == -3:
    is_bingo = True


if is_bingo:
    print('Yes')
else:
    print('No')

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

for y in range(3):
    for b in b_list:
        if b in a_list[y]:
            index = a_list[y].index(b)
            a_list[y][index] = -1

is_bingo = False
for y in range(3):
    if sum(a_list[y]) == -3:
        is_bingo = True
        break

for x in range(3):
    if a_list[0][x]+a_list[1][x]+a_list[2][x] == -3:
        is_bingo = True
        break

if a_list[0][0]+a_list[1][1]+a_list[2][2] == -3:
    is_bingo = True
elif a_list[0][2]+a_list[1][1]+a_list[2][0] == -3:
    is_bingo = True


if is_bingo:
    print('Yes')
else:
    print('No')