qyliang/CodeNanoFix huggingface dataset:
Buggy code:
A     = [list(map(int, input().split())) for i in range(3)]
N     = int(input())
lst_b = [int(input()) for i in range(N)]


def main(A, N, lst_b):
    
    matrix_result = [[False]*3 for i in range(3)]
    flag_bingo = False

    for b in lst_b:
        for i in range(3):
            for j in range(3):
                if A[i][j] == b:
                    matrix_result[i][j] = True
        
    for i in range(3):
        # check tate
        if (matrix_result[0][i] and matrix_result[1][i] and matrix_result[2][i]):
            flag_bingo = True
        # check yoko
        if (matrix_result[i][0] and matrix_result[i][1] and matrix_result[i][2]):
            flag_bingo = True
    
    # check naname
    if (matrix_result[0][0] and matrix_result[1][1] and matrix_result[2][2]):
        flag_bingo = True
    elif (matrix_result[0][2] and matrix_result[1][1] and matrix_result[2][0]):
        flag_bingo = True

    print(matrix_result)
    
    if flag_bingo: return "Yes"
    else         : return "No"
    

if __name__ == "__main__":

    answer = main(A, N, lst_b)
    print(answer)
    

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


def main(A, N, lst_b):
    
    matrix_result = [[False]*3 for i in range(3)]
    flag_bingo = False

    for b in lst_b:
        for i in range(3):
            for j in range(3):
                if A[i][j] == b:
                    matrix_result[i][j] = True
        
    for i in range(3):
        # check tate
        if (matrix_result[0][i] and matrix_result[1][i] and matrix_result[2][i]):
            flag_bingo = True
        # check yoko
        if (matrix_result[i][0] and matrix_result[i][1] and matrix_result[i][2]):
            flag_bingo = True
    
    # check naname
    if (matrix_result[0][0] and matrix_result[1][1] and matrix_result[2][2]):
        flag_bingo = True
    elif (matrix_result[0][2] and matrix_result[1][1] and matrix_result[2][0]):
        flag_bingo = True
    
    if flag_bingo: return "Yes"
    else         : return "No"
    

if __name__ == "__main__":

    answer = main(A, N, lst_b)
    print(answer)
Buggy code:
l=list(map(int,imput().split()))
l+=list(map(int,imput().split()))
l+=list(map(int,imput().split()))

n=int(input())

ans_list=[False]*9

for i in range(n):
  num=int(input())
  if num in l:
    index=l.index(num)
    ans_list[index]=True
    
if ans_list[0] and ans_list[1] and ans_list[2]:
  print("Yes")
elif ans_list[0] and ans_list[3] and ans_list[6]:
  print("Yes")
elif ans_list[3] and ans_list[4] and ans_list[5]:
  print("Yes")
elif ans_list[6] and ans_list[7] and ans_list[8]:
  print("Yes")
elif ans_list[1] and ans_list[4] and ans_list[7]:
  print("Yes")
elif ans_list[2] and ans_list[5] and ans_list[8]:
  print("Yes")
elif ans_list[0] and ans_list[4] and ans_list[8]:
  print("Yes")
elif ans_list[2] and ans_list[4] and ans_list[6]:
  print("Yes")
else:
  print("No")

Fixed code:
l=list(map(int,input().split()))
l+=list(map(int,input().split()))
l+=list(map(int,input().split()))

n=int(input())

ans_list=[False]*9

for i in range(n):
  num=int(input())
  if num in l:
    index=l.index(num)
    ans_list[index]=True
    
if ans_list[0] and ans_list[1] and ans_list[2]:
  print("Yes")
elif ans_list[0] and ans_list[3] and ans_list[6]:
  print("Yes")
elif ans_list[3] and ans_list[4] and ans_list[5]:
  print("Yes")
elif ans_list[6] and ans_list[7] and ans_list[8]:
  print("Yes")
elif ans_list[1] and ans_list[4] and ans_list[7]:
  print("Yes")
elif ans_list[2] and ans_list[5] and ans_list[8]:
  print("Yes")
elif ans_list[0] and ans_list[4] and ans_list[8]:
  print("Yes")
elif ans_list[2] and ans_list[4] and ans_list[6]:
  print("Yes")
else:
  print("No")
Buggy code:
a1_1, a1_2, a1_3 = map(int, input().split())
a2_1, a2_2, a2_3 = map(int, input().split())
a3_1, a3_2, a3_3 = map(int, input().split())
a_list=[a1_1, a1_2, a1_3, a2_1, a2_2, a2_3, a3_1, a3_2, a3_3]
n = int(input())
b=[]
for i in range(n):
  b_i = int(input())
  b.append(b_i)
  for j, a_j in enumerate(a_list):
    if a_j == b_i:
      a_list[j] = -1
    
if ((a_list[0]==-1 and a_list[3] == -1 and a_list[6] == -1) or
    (a_list[1]==-1 and a_list[4] == -1 and a_list[7] == -1) or
    (a_list[2]==-1 and a_list[5] == -1 and a_list[8] == -1) or
	(a_list[0]==-1 and a_list[4] == -1 and a_list[8] == -1) or
	(a_list[2]==-1 and a_list[4] == -1 and a_list[6] == -1)):
  print("YES")
else:
  print("NO")

Fixed code:
a1_1, a1_2, a1_3 = map(int, input().split())
a2_1, a2_2, a2_3 = map(int, input().split())
a3_1, a3_2, a3_3 = map(int, input().split())
a_list=[a1_1, a1_2, a1_3, a2_1, a2_2, a2_3, a3_1, a3_2, a3_3]
n = int(input())
b=[]
for i in range(n):
  b_i = int(input())
  b.append(b_i)
  for j, a_j in enumerate(a_list):
    if a_j == b_i:
      a_list[j] = -1
    
if ((a_list[0]==-1 and a_list[1] == -1 and a_list[2] == -1) or
    (a_list[3]==-1 and a_list[4] == -1 and a_list[5] == -1) or
    (a_list[6]==-1 and a_list[7] == -1 and a_list[8] == -1) or
    (a_list[0]==-1 and a_list[3] == -1 and a_list[6] == -1) or
    (a_list[1]==-1 and a_list[4] == -1 and a_list[7] == -1) or
    (a_list[2]==-1 and a_list[5] == -1 and a_list[8] == -1) or
    (a_list[0]==-1 and a_list[4] == -1 and a_list[8] == -1) or
	(a_list[2]==-1 and a_list[4] == -1 and a_list[6] == -1)):
  print("Yes")
else:
  print("No")
Buggy code:
# coding: utf-8
# Your code here!
ls = []
count = [0]*9
for i in range(3):
    ls.extend(input().split(' '))
for i in range(int(input())):
    s = input()
    if s in ls:
        i = ls.index(s)
        count[i]="1"
flag = 0
for i in range(3):
    if count[i] == count[i+3] == count[i+6]=="1":
        flag = 1
        break
if flag == 0:
	for i in range(0,8,3):
    	if count[i] == count[i+1] == count[i+2] == "1":
       		flag = 1
        	break
if count[0]==count[4]==count[8]=="1":
    flag = 1
if count[2] == count[4] == count[6] == "1":
    flag = 1
if flag == 1:
    print("Yes")
elif flag == 0:
    print("No")

Fixed code:
# coding: utf-8
# Your code here!
ls = []
count = [0]*9
for i in range(3):
    ls.extend(input().split(' '))
for i in range(int(input())):
    s = input()
    if s in ls:
        i = ls.index(s)
        count[i]="1"
flag = 0
for i in range(3):
    if count[i] == count[i+3] == count[i+6]=="1":
        flag = 1
        break
for i in range(0,8,3):
    if count[i] == count[i+1] == count[i+2] == "1":
        flag = 1
        break
if count[0]==count[4]==count[8]=="1":
    flag = 1
if count[2] == count[4] == count[6] == "1":
    flag = 1
if flag == 1:
    print("Yes")
elif flag == 0:
    print("No")
Buggy code:
input1 = list(map(int, (input().split())))
input2 = list(map(int, (input().split())))
input3 = list(map(int, (input().split())))

a = input1 + input2 + input3

n = int(input())

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

for s in b:
    for i in range(9):
        if a[i] == s:
            a[i] = 0

for i in range(3):
    if(a[i] + a[i+3] + a[i+6] == 0):
        print("Yes")
        exit(0)

for i in [0, 3, 6]:
    print(i)
    if(a[i] + a[i+1] + a[i+2] == 0):
        print("Yes")
        exit(0)

if(a[0] + a[4] + a[8] == 0):
    print("Yes")
    exit(0)

if(a[2] + a[4] + a[6] == 0):
    print("Yes")
    exit(0)

print("No")


Fixed code:
input1 = list(map(int, (input().split())))
input2 = list(map(int, (input().split())))
input3 = list(map(int, (input().split())))

a = input1 + input2 + input3

n = int(input())

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

# print(b)
for s in b:
    for i in range(9):
        if a[i] == s:
            a[i] = 0

for i in range(3):
    if(a[i] + a[i+3] + a[i+6] == 0):
        print("Yes")
        exit(0)

for i in [0, 3, 6]:
    # print(i)
    if(a[i] + a[i+1] + a[i+2] == 0):
        print("Yes")
        exit(0)

if(a[0] + a[4] + a[8] == 0):
    print("Yes")
    exit(0)

if(a[2] + a[4] + a[6] == 0):
    print("Yes")
    exit(0)

print("No")
Buggy code:
import sys
import math
sys.setrecursionlimit(int(1e6))

A = [[0]*3]*3
A[0] = list(map(int, input().split()))
A[1] = list(map(int, input().split()))
A[2] = list(map(int, input().split()))

N = int(input())
b = [0] * N
for i in range(N):
    b[i] = int(input())

card = [[0]*3]*3
n = 0
for bn in b:
    for m in range(3*3):
        i = m % 3
        j = m // 3
        if (A[i][j] == bn):
            card[i][j] = 1
            break

ans = 'No'
for i in range(3):
    if sum(A[i]) == 3:
        ans = 'Yes'
        break
    if sum([A[0][i], A[1][i], A[2][i]]) == 3:
        ans = 'Yes'
        break
else:
    if sum([A[0][0], A[1][1], A[2][2]]) == 3:
        ans = 'Yes'
    elif sum([A[2][0], A[1][1], A[0][2]]) == 3:
        ans = 'Yes'

print(ans)


Fixed code:
import sys
import math
sys.setrecursionlimit(int(1e6))

A = [[0]*3]*3
A[0] = list(map(int, input().split()))
A[1] = list(map(int, input().split()))
A[2] = list(map(int, input().split()))

N = int(input())
b = [0] * N
for i in range(N):
    b[i] = int(input())

c = [[0]*3 for i in range(3)]
for bn in b:
    for m in range(3*3):
        i = m % 3
        j = m // 3
        if (A[i][j] == bn):
            c[i][j] = 1
            break

ans = 'No'
for i in range(3):
    if sum(c[i]) == 3:
        ans = 'Yes'
        break
    if sum([c[0][i], c[1][i], c[2][i]]) == 3:
        ans = 'Yes'
        break
else:
    if sum([c[0][0], c[1][1], c[2][2]]) == 3:
        ans = 'Yes'
    elif sum([c[2][0], c[1][1], c[0][2]]) == 3:
        ans = 'Yes'

print(ans)
Buggy code:
import numpy as np
a1 = np.zeros(3, dtype=int)
a2 = np.zeros(3, dtype=int)
a3 = np.zeros(3, dtype=int)

for i in range(3):
    a1[i], a2[i], a3[i] = map(int, input().split())

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

a = np.array([a1, a2, a3]).T.flatten()

for i in range(n):
    a[np.where(a == b[i])] = 0
a = a.reshape(3, -1)

print("Yes") if a[0].sum()==0 or a[1].sum()==0 or a[2].sum()==0 or a[:, 0].sum()==0 or a[:, 1].sum()==0 or a[:, 2].sum()==0 or np.diag(a).sum()==0 or np.diag(a[::-1]).sum()==0 else "No"

Fixed code:
import numpy as np
a1 = np.zeros(3, dtype=int)
a2 = np.zeros(3, dtype=int)
a3 = np.zeros(3, dtype=int)

for i in range(3):
    a1[i], a2[i], a3[i] = map(int, input().split())

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

a = np.array([a1, a2, a3]).T.flatten()

for i in range(n):
    a[np.where(a == b[i])] = 0
a = a.reshape(3, -1)

print("Yes") if a[0].sum()==0 or a[1].sum()==0 or a[2].sum()==0 or a[:, 0].sum()==0 or a[:, 1].sum()==0 or a[:, 2].sum()==0 or np.diag(a).sum()==0 or np.diag(a[::-1]).sum()==0 else print("No")
Buggy code:
A=[]
b=[]
c=[[0,0,0],[0,0,0],[0,0,0]]
d=[[0,0,0],[0,0,0],[0,0,0]]
for i in range(3):
    x,y,z=map(int,input().split())
    A.append([x,y,z])

N = int(input())

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

for i in range(3):
    for j in range(3):
        if A[i][j] in b:
            c[i][j] = 1
            d[j][i] = 1

print(c)
print(d)

if [1,1,1] in c[0:2]:
    print('Yes')
elif [1,1,1] in d[0:2]:
    print('Yes')
elif (c[0][0]+c[1][1]+c[2][2] == 3) or (d[0][0]+d[1][1]+d[2][2] == 3):
    print('Yes')
else:
    print('No')


Fixed code:
A=[]
b=[]
c=[[0,0,0],[0,0,0],[0,0,0]]
d=[[0,0,0],[0,0,0],[0,0,0]]
for i in range(3):
    x,y,z=map(int,input().split())
    A.append([x,y,z])

N = int(input())

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

for i in range(3):
    for j in range(3):
        if A[i][j] in b:
            c[i][j] = 1
            d[j][i] = 1

if [1,1,1] in c:
    print('Yes')
elif [1,1,1] in d:
    print('Yes')
elif (c[0][0]+c[1][1]+c[2][2] == 3) or (c[0][2]+c[1][1]+c[2][0] == 3):
    print('Yes')
else:
    print('No')
Buggy code:
A = []
A += input().split()
A += input().split()
A+= input().split()
N = int(input())
b = [input() for _ in range(N)]

for i in range(N):
  if b[i] in A:
    A[A.index(b[i])] = '.'
    
if (A[0] == '.' and A[3] == '.' and A[6] == '.') or (A[1] == '.' and A[4] == '.' and A[7] == '.')
or (A[2] == '.' and A[5] == '.' and A[8] == '.') or (A[0] == '.' and A[1] == '.' and A[2] == '.')
or (A[3] == '.' and A[4] == '.' and A[5] == '.') or (A[6] == '.' and A[7] == '.' and A[8] == '.')
or (A[0] == '.' and A[4] == '.' and A[8] == '.') or (A[2] == '.' and A[4] == '.' and A[6] == '.'):
  print('Yes')
else: print('No')

Fixed code:
A = []
A += input().split()
A += input().split()
A += input().split()
N = int(input())
b = [input() for _ in range(N)]
 
for i in range(N):
  if b[i] in A:
    A[A.index(b[i])] = '.'
    
if (A[0] == '.' and A[3] == '.' and A[6] == '.') or (A[1] == '.' and A[4] == '.' and A[7] == '.') or (A[2] == '.' and A[5] == '.' and A[8] == '.') or (A[0] == '.' and A[1] == '.' and A[2] == '.') or (A[3] == '.' and A[4] == '.' and A[5] == '.') or (A[6] == '.' and A[7] == '.' and A[8] == '.') or (A[0] == '.' and A[4] == '.' and A[8] == '.') or (A[2] == '.' and A[4] == '.' and A[6] == '.'): print('Yes')
else: print('No')
Buggy code:
import sys

matrix = []
for i in range(3):
  matrix.append([int(j) for j in input().split()])
print(matrix)

def find(b):
  for i in range(3):
    for j in range(3):
      if matrix[i][j] == b:
        return (i, j)
  return None

matched = [[False for _ in range(3)]
           for _ in range(3)]
n = int(input())
for i in range(n):
  b = int(input())
  result = find(b)
  if result is not None:
    matched[result[0]][result[1]] = True
    
for i in range(3):
  ans = True
  for j in range(3):
    if not matched[i][j]:
      ans = False
      break
  if ans:
    print('Yes')
    sys.exit(0)
  
for i in range(3):
  ans = True
  for j in range(3):
    if not matched[j][i]:
      ans = False
      break
  if ans:
    print('Yes')
    sys.exit(0)
  
if matched[0][0] and matched[1][1] and matched[1][1]:
  print('Yes')
  sys.exit(0)

if matched[0][2] and matched[1][1] and matched[2][0]:
  print('Yes')
  sys.exit(0)
  
print('No')
    

Fixed code:
import sys

matrix = []
for i in range(3):
  matrix.append([int(j) for j in input().split()])
#print(matrix)

def find(b):
  for i in range(3):
    for j in range(3):
      if matrix[i][j] == b:
        return (i, j)
  return None

matched = [[False for _ in range(3)]
           for _ in range(3)]
n = int(input())
for i in range(n):
  b = int(input())
  result = find(b)
  if result is not None:
    matched[result[0]][result[1]] = True
    
for i in range(3):
  ans = True
  for j in range(3):
    if not matched[i][j]:
      ans = False
      break
  if ans:
    print('Yes')
    sys.exit()
  
for i in range(3):
  ans = True
  for j in range(3):
    if not matched[j][i]:
      ans = False
      break
  if ans:
    print('Yes')
    sys.exit()
  
if matched[0][0] and matched[1][1] and matched[1][1]:
  print('Yes')
  sys.exit()

if matched[0][2] and matched[1][1] and matched[2][0]:
  print('Yes')
  sys.exit()
  
print('No')
Buggy code:
import sys
card = [ list(map(int,input().split())) for a in range(3) ]
N = int(input())
point = [ int(input()) for a in range(N) ]

# cut holes
for I in point:
    for J in card:
        if I in J:
            J.index(I)
            J[J.index(I)] = "H"
print(card)
# vertical check
for K in range(3):
    check = set([ x[K] for x in card ])
    if len(check) == 1 and list(check)[0] == "H":
        print('Yes')
        sys.exit()
# horizon check
for L in card:
    check = set(L)
    if len(check) == 1 and list(check)[0] == "H":
        print('Yes')
        sys.exit()
# diagonal check
LtoR = set([ card[M][M] for M in range(3)])
RtoL = set([ card[M][-M-1] for M in range(3)])
if len(LtoR) == 1 and list(LtoR)[0] == "H" or  len(RtoL) == 1 and list(RtoL)[0] == "H":    
    print('Yes')
    sys.exit()
print('No')

Fixed code:
import sys
card = [ list(map(int,input().split())) for a in range(3) ]
N = int(input())
point = [ int(input()) for a in range(N) ]

# cut holes
for I in point:
    for J in card:
        if I in J:
            J.index(I)
            J[J.index(I)] = "H"
# vertical check
for K in range(3):
    check = set([ x[K] for x in card ])
    if len(check) == 1 and list(check)[0] == "H":
        print('Yes')
        sys.exit()
# horizon check
for L in card:
    check = set(L)
    if len(check) == 1 and list(check)[0] == "H":
        print('Yes')
        sys.exit()
# diagonal check
LtoR = set([ card[M][M] for M in range(3)])
RtoL = set([ card[M][-M-1] for M in range(3)])
if len(LtoR) == 1 and list(LtoR)[0] == "H" or  len(RtoL) == 1 and list(RtoL)[0] == "H":    
    print('Yes')
    sys.exit()
print('No')
Buggy code:
import sys

def input():
    return sys.stdin.readline().strip()

def main():
    
    a = [[0]*3 for i in range(3)]
    for i in range(3):
        a[i] = list(map(int, input().split()))
    n = int(input())
    b = [0]*n
    bingo = "No"
    for i in range(n):
        b[i] = int(input())
        for k in range(3):
            if a[k][0] == b[i]:
                a[k][0] = 0
            if a[k][1] == b[i]:
                a[k][1] = 0
            if a[k][2] == b[i]:
                a[k][2] = 0
    for i in range(3):
        if a[i][0]+a[i][1]+a[i][2] == 0:
            bingo = "Yes"
    for i in range(3):
        if a[0][i]+a[1][i]+a[2][i] == 0:
            bingo = "Yes"
    if a[0][0]+a[1][1]+a[2][2] == 0:
        bingo = "Yes"
    if a[2][0]+a[1][1]+a[0][2] == 0:
        bingo = "Yes"
     
    print(bingo)


Fixed code:
import sys

def input():
    return sys.stdin.readline().strip()

def main():
    
    a = [[0]*3 for i in range(3)]
    for i in range(3):
        a[i] = list(map(int, input().split()))
    n = int(input())
    b = [0]*n
    bingo = "No"
    for i in range(n):
        b[i] = int(input())
        for k in range(3):
            if a[k][0] == b[i]:
                a[k][0] = 0
            if a[k][1] == b[i]:
                a[k][1] = 0
            if a[k][2] == b[i]:
                a[k][2] = 0
    for i in range(3):
        if a[i][0]+a[i][1]+a[i][2] == 0:
            bingo = "Yes"
    for i in range(3):
        if a[0][i]+a[1][i]+a[2][i] == 0:
            bingo = "Yes"
    if a[0][0]+a[1][1]+a[2][2] == 0:
        bingo = "Yes"
    if a[2][0]+a[1][1]+a[0][2] == 0:
        bingo = "Yes"
     
    print(bingo)
main()
Buggy code:
d=[list(map(int,input().split()))for i in range(3)]
row=int(input())
num=[int(input()) for j in range(row)]
bingo=0
for a in range(3):
  if d[0][a] and d[1][a] and d[2][a] in num:
    bingo=bingo+1
  elif d[a][0] and d[a][1] and d[a][1] in num:
    bingo=bingo+1
if d[1][1] and d[2][2] and d[3][3] in num:
  bingo=bingo+1
elif d[3][1] and d[2][2] and d[1][3] in num:
  bingo=bingo+1
if bingo>0:
  print('Yes')
else:
  print('No')

Fixed code:
d=[list(map(int,input().split()))for i in range(3)]
row=int(input())
num=[int(input()) for j in range(row)]
bingo=0
for a in range(3):
  if d[0][a] in num and d[1][a] in num and d[2][a] in num:
    bingo=bingo+1
  if d[a][0] in num and d[a][1] in num and d[a][2] in num:
    bingo=bingo+1
if d[1][1] in num and d[2][2] in num and d[0][0] in num:
  bingo=bingo+1
if d[1][1] in num and d[0][2] in num and d[2][0] in num:
  bingo=bingo+1
if bingo>0:
  print('Yes')
else:
  print('No')
Buggy code:
a = list(list(map(int , input().split())) for l in range(3))
n = int(input())

for i in range(input()):
  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]==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[2][0]==a[1][1]==a[0][2]==0:ans="Yes"
print(ans)

Fixed code:
a=[list(map(int,input().split()))for _ in range(3)]
for i in range(int(input())):
  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]==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[2][0]==a[1][1]==a[0][2]==0:ans="Yes"
print(ans)
Buggy code:
a = []
for i in range(3):
    a.append([int(x) for x in input().split()])
bing = [([0]*3),([0]*3),([0]*3)]

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

for b in bs:
    for i in range(3):
        for j in range(3):
            if a[i][j]==b:
                bing[i][j]=1

def isbingo(board):
    for i in range(3):
        if sum(board[i])==3:
            return True
    for j in range(3):
        if sum([board[i][j] for i in range(3)])==3:
            return True
    if sum([board[0][0],board[1][1],board[2][2]])==3:
        return True
    if sum([board[0][2],board[1][1],board[2][0]])==3:
        return True
    return False
print(a)
print('Yes'if isbingo(bing) else 'No')

Fixed code:
a = []
for i in range(3):
    a.append([int(x) for x in input().split()])
bing = [[0]*3,[0]*3,[0]*3]

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

for b in bs:
    for i in range(3):
        for j in range(3):
            if a[i][j]==b:
                bing[i][j]=1



def isbingo(board):
    for i in range(3):
        if sum(board[i])==3:
            return True
    for j in range(3):
        if sum([board[i][j] for i in range(3)])==3:
            return True
    if sum([board[0][0],board[1][1],board[2][2]])==3:
        return True
    if sum([board[0][2],board[1][1],board[2][0]])==3:
        return True
    return False
print('Yes'if isbingo(bing) else 'No')
Buggy code:
bingo=[]
for i in range(3):
  a=list(map(int,input().split()))
  bingo.append(a)
  
n=int(input())
for i in range(n):
  b=int(input())
  for j in range(3):
    if b in bingo[i]:
      bingo[i][bingo[i].index(b)]=0
      
def hantei(l):
  for i in range(3):
    if all([l[i][j]==0 for j in range(3)]):
      return 'Yes'
    
    elif all([l[j][i]==0 for j in range(3)]):
      return 'Yes'
    
    elif l[0][0]==0 and l[1][1]==0 and l[2][2]==0:
      return 'Yes'
    
    elif l[0][2]==0 and l[1][1]==0 and l[2][0]==0:
      return 'Yes'
    
    else:
      return 'No'
    
print(hantei(bingo))
    
    

Fixed code:
bingo=[]
for i in range(3):
  a=list(map(int,input().split()))
  bingo.append(a)
  
n=int(input())
for i in range(n):
  b=int(input())
  for j in range(3):
    if b in bingo[j]:
      bingo[j][bingo[j].index(b)]=0
      
def hantei(l):
  for i in range(3):
    if all([l[i][j]==0 for j in range(3)]):
      return 'Yes'
    
    elif all([l[j][i]==0 for j in range(3)]):
      return 'Yes'
    
    elif l[0][0]==0 and l[1][1]==0 and l[2][2]==0:
      return 'Yes'
    
    elif l[0][2]==0 and l[1][1]==0 and l[2][0]==0:
      return 'Yes'
    
    else:
      continue
      
  return 'No'
    
#print(bingo)
print(hantei(bingo))
Buggy code:
import sys
L = []
bingo = set()
Numbers = []
testor = 0
for i in range(3):
  a,b,c = map(int,input().split())
  L.append((a,b,c)) #00 10 20/ 01 11 21/ 02 12 22/00 11 22/ 20 11 02/
N = int(input())
for i in range(3):
  a = L[0][i] 
  b = L[1][i]
  c = L[2][i]
  L.append((a,b,c))
a = L[0][0]
b = L[1][1]
c = L[2][2]
L.append((a,b,c))
a = L[2][0] 
b = L[1][1]
c = L[0][2]
L.append((a,b,c))
print(L)
for i in range(N):
  Numbers.append(int(input()))
for i in range(8): #8 bingos pattern
  bingo = L[i]
  for k in range(N):
    if Numbers[k] in bingo:
      testor += 1
    if testor == 3:
        print('Yes')
        sys.exit(0)
  testor = 0
print('No')

Fixed code:
import sys
L = []
bingo = set()
Numbers = []
testor = 0
for i in range(3):
  a,b,c = map(int,input().split())
  L.append((a,b,c)) #00 10 20/ 01 11 21/ 02 12 22/00 11 22/ 20 11 02/
N = int(input())
for i in range(3):
  a = L[0][i] 
  b = L[1][i]
  c = L[2][i]
  L.append((a,b,c))
a = L[0][0]
b = L[1][1]
c = L[2][2]
L.append((a,b,c))
a = L[2][0] 
b = L[1][1]
c = L[0][2]
L.append((a,b,c))
for i in range(N):
  Numbers.append(int(input()))
for i in range(8): #8 bingos pattern
  bingo = L[i]
  for k in range(N):
    if Numbers[k] in bingo:
      testor += 1
    if testor == 3:
        print('Yes')
        sys.exit(0)
  testor = 0
print('No')