qyliang/CodeNanoFix huggingface dataset:
Buggy code:
A11,A12,A13 = map(int,input().split())
A21,A22,A23 = map(int,input().split())
A31,A32,A33 = map(int,input().split())

Alist = []
Alist.append(A11)
Alist.append(A12)
Alist.append(A13)
Alist.append(A21)
Alist.append(A22)
Alist.append(A23)
Alist.append(A31)
Alist.append(A32)
Alist.append(A33)
bingolist =[0]*9

N = int(input())
#print (N)
for i in range(N):
  b = int(input())
  print (b)
  for j in range(len(bingolist)):
    if b ==Alist[j]:
      bingolist[j] = 1

if sum(bingolist[0:3])==3 or sum(bingolist[3:6])==3 or sum(bingolist[6:9])==3 or (bingolist[0]+bingolist[3]+bingolist[6])==3 or (bingolist[1]+bingolist[4]+bingolist[7])==3 or (bingolist[2]+bingolist[5]+bingolist[8])==3 or (bingolist[0]+bingolist[4]+bingolist[8])==3 or (bingolist[2]+bingolist[4]+bingolist[6])==3:
  print ("Yes")
else :
  print ("No")
#print (bingolist[0:3])
#print (bingolist[3:6])
#print (bingolist[6:9])
#print (bingolist)

Fixed code:
A11,A12,A13 = map(int,input().split())
A21,A22,A23 = map(int,input().split())
A31,A32,A33 = map(int,input().split())

Alist = []
Alist.append(A11)
Alist.append(A12)
Alist.append(A13)
Alist.append(A21)
Alist.append(A22)
Alist.append(A23)
Alist.append(A31)
Alist.append(A32)
Alist.append(A33)
bingolist =[0]*9

N = int(input())
#print (N)
for i in range(N):
  b = int(input())
  #print (b)
  for j in range(len(bingolist)):
    if b ==Alist[j]:
      bingolist[j] = 1

if sum(bingolist[0:3])==3 or sum(bingolist[3:6])==3 or sum(bingolist[6:9])==3 or (bingolist[0]+bingolist[3]+bingolist[6])==3 or (bingolist[1]+bingolist[4]+bingolist[7])==3 or (bingolist[2]+bingolist[5]+bingolist[8])==3 or (bingolist[0]+bingolist[4]+bingolist[8])==3 or (bingolist[2]+bingolist[4]+bingolist[6])==3:
  print ("Yes")
else :
  print ("No")
#print (bingolist[0:3])
#print (bingolist[3:6])
#print (bingolist[6:9])
#print (bingolist)
Buggy code:
a=[0]
a.extend(list(map(int,input().split())))
a.extend(list(map(int,input().split())))
a.extend(list(map(int,input().split())))
print(a)
n=int(input())
for i in range(n):
    b=int(input())
    for k in range(10):
        if a[k]==b:
            a[k]=0
print(a)
t="No"
if a[1]==0 and a[2]==0 and a[3]==0:
    t="Yes"
if a[4]==0 and a[5]==0 and a[6]==0:
    t="Yes"
if a[7]==0 and a[8]==0 and a[9]==0:
    t="Yes"
if a[1]==0 and a[4]==0 and a[7]==0:
    t="Yes"
if a[2]==0 and a[5]==0 and a[8]==0:
    t="Yes"
if a[3]==0 and a[6]==0 and a[9]==0:
    t="Yes"
if a[1]==0 and a[5]==0 and a[9]==0:
    t="Yes"
if a[3]==0 and a[5]==0 and a[7]==0:
    t="Yes"

print(t)


Fixed code:
a=[0]
a.extend(list(map(int,input().split())))
a.extend(list(map(int,input().split())))
a.extend(list(map(int,input().split())))
n=int(input())
for i in range(n):
    b=int(input())
    for k in range(10):
        if a[k]==b:
            a[k]=0
t="No"
if a[1]==0 and a[2]==0 and a[3]==0:
    t="Yes"
if a[4]==0 and a[5]==0 and a[6]==0:
    t="Yes"
if a[7]==0 and a[8]==0 and a[9]==0:
    t="Yes"
if a[1]==0 and a[4]==0 and a[7]==0:
    t="Yes"
if a[2]==0 and a[5]==0 and a[8]==0:
    t="Yes"
if a[3]==0 and a[6]==0 and a[9]==0:
    t="Yes"
if a[1]==0 and a[5]==0 and a[9]==0:
    t="Yes"
if a[3]==0 and a[5]==0 and a[7]==0:
    t="Yes"

print(t)
Buggy code:
A = [list(map(int, input().split())) for i in range(3)]
N = int(input())
B = [[0 for i in range(3)] for j in range(3)]
for i in range(N):
  a = int(input())
  for m in range(3):
    for n in range(3):
      if a == A[m][n]:
        B[m][n] = 1
p = 'No'
for i in range(3):
  cnt1 = 0
  cnt2 = 0
  for j in range(3):
    if B[i][j] == 1:
      cnt1 += 1
    if B[j][i] == 1:
      cnt2 += 1
  if cnt1 == 3 or cnt2 == 3:
    p = 'Yes'
    break
cnt3, cnt4 = 0, 0
for i in range(3):
  if B[i][i] == 1:
    cnt3 += 1
  if B[i][3-i] == 1:
    cnt4 += 1
if cnt3 == 3 or cnt4 == 3:
  p = 'Yes'
print(p)

Fixed code:
A = [list(map(int, input().split())) for i in range(3)]
N = int(input())
B = [[0 for i in range(3)] for j in range(3)]
for i in range(N):
  a = int(input())
  for m in range(3):
    for n in range(3):
      if a == A[m][n]:
        B[m][n] = 1
p = 'No'
for i in range(3):
  cnt1 = 0
  cnt2 = 0
  for j in range(3):
    if B[i][j] == 1:
      cnt1 += 1
    if B[j][i] == 1:
      cnt2 += 1
  if cnt1 == 3 or cnt2 == 3:
    p = 'Yes'
    break
cnt3, cnt4 = 0, 0
for i in range(3):
  if B[i][i] == 1:
    cnt3 += 1
  if B[i][2-i] == 1:
    cnt4 += 1
if cnt3 == 3 or cnt4 == 3:
  p = 'Yes'
print(p)
Buggy code:
A1 = input().split()
A2 = input().split()
A3 = input().split()

hit_example = [7,56,73,84,146,273,292,448]
b = 0
ans = "no"

N = int(input())
for i in range(N):
  x = int(input())
  if int(A1[0]) == x:
    b += 256
  elif int(A1[1]) == x:
    b += 128
  elif int(A1[2]) == x:
    b += 64
  elif int(A2[0]) == x:
    b += 32
  elif int(A2[1]) == x:
    b += 16
  elif int(A2[2]) == x:
    b += 8
  elif int(A3[0]) == x:
    b += 4
  elif int(A3[1]) == x:
    b += 2
  elif int(A3[2]) == x:
    b += 1

for val in hit_example:
  if val & b == val:
    ans = "yes"
    break
    
print(ans)

Fixed code:
A1 = input().split()
A2 = input().split()
A3 = input().split()

hit_example = [7,56,73,84,146,273,292,448]
b = 0
ans = "No"

N = int(input())
for i in range(N):
  x = int(input())
  if int(A1[0]) == x:
    b += 256
  elif int(A1[1]) == x:
    b += 128
  elif int(A1[2]) == x:
    b += 64
  elif int(A2[0]) == x:
    b += 32
  elif int(A2[1]) == x:
    b += 16
  elif int(A2[2]) == x:
    b += 8
  elif int(A3[0]) == x:
    b += 4
  elif int(A3[1]) == x:
    b += 2
  elif int(A3[2]) == x:
    b += 1

for val in hit_example:
  if val & b == val:
    ans = "Yes"
    break
    
print(ans)
Buggy code:
def main(a: list, n: int, b: list):
    res = [[False, False, False], [False, False, False], [False, False, False]]
    for b in b:
        for i, a_row in enumerate(a):
            for j, a_col in enumerate(a_row):
                if b == a_col:
                    res[i][j] = True

    for i in range(3):
        # row
        if False not in res[i]:
            print("Yes")
            return

        # col
        if False not in [res[i][0], res[i][1], res[i][2]]:
            print("Yes")
            return

    # cross
    # ->
    if False not in [res[0][0], res[1][1], res[2][2]]:
        print("Yes c")
        return

    # <-
    if False not in [res[0][2], res[1][1], res[2][0]]:
        print("Yes c")
        return

    print("No")


if __name__ == "__main__":
    a = [list(map(int, input().split())) for _ in range(3)]
    n = int(input())
    b = [int(input()) for _ in range(n)]

    main(a, n, b)


Fixed code:
def main(a: list, n: int, b: list):
    res = [[False, False, False], [False, False, False], [False, False, False]]
    for b in b:
        for i, a_row in enumerate(a):
            for j, a_col in enumerate(a_row):
                if b == a_col:
                    res[i][j] = True

    for i in range(3):
        # row
        if False not in res[i]:
            print("Yes")
            return

        # col
        if False not in [res[0][i], res[1][i], res[2][i]]:
            print("Yes")
            return

    # cross
    # ->
    if False not in [res[0][0], res[1][1], res[2][2]]:
        print("Yes")
        return

    # <-
    if False not in [res[0][2], res[1][1], res[2][0]]:
        print("Yes")
        return

    print("No")


if __name__ == "__main__":
    a = [list(map(int, input().split())) for _ in range(3)]
    n = int(input())
    b = [int(input()) for _ in range(n)]

    main(a, n, b)
Buggy code:
b = []
for i in range(3):
  lst = list(map(int,input().split()))
  b.append(lst)
n = int(input())
for i in range(n):
  a = int(input())
  for j in range(3):
    for k in range(3):
      if (b[j][k] == a):
        b[j][k] = 0
if (b[0][0] = b[0][1] = b[0][2] or b[1][0] = b[1][1] = b[1][2] or b[2][0] = b[2][1] = b[2][2] or b[0][0] = b[1][0] = b[2][0] or b[0][1] = b[1][1] = b[2][1] or b[0][2] = b[1][2] = b[2][2] or b[0][0] = b[1][1] = b[2][2] or b[0][2] = b[1][1] = b[2][0]):
  print("Yes")
else:
  print("No")
  

Fixed code:
b = []
for i in range(3):
  lst = list(map(int,input().split()))
  b.append(lst)
n = int(input())
for i in range(n):
  a = int(input())
  for j in range(3):
    for k in range(3):
      if (b[j][k] == a):
        b[j][k] = 0
if (b[0][0] == b[0][1] == b[0][2] or b[1][0] == b[1][1] == b[1][2] or b[2][0] == b[2][1] == b[2][2] or b[0][0] == b[1][0] == b[2][0] or b[0][1] == b[1][1] == b[2][1] or b[0][2] == b[1][2] == b[2][2] or b[0][0] == b[1][1] == b[2][2] or b[0][2] == b[1][1] == b[2][0]):
  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())
N = int(input())
B = []
for _ in range(N):
    B.append(input())

a=str('yes')
b=str('no')
if A1_1 in B and A1_2 in B and A1_3 in B:
     print(a)
elif A2_1 in B and A2_2 in B and A2_3 in B:
    print(a)
elif A3_1 in B and A3_2 in B and A3_3 in B:
     print(a)
elif A1_1 in B and A2_1 in B and A3_1 in B:
    print(a)
elif A1_2 in B and A2_2 in B and A3_2 in B:
    print(a)
elif A1_3 in B and A2_3 in B and A3_3 in B:
    print(a)
elif A1_1 in B and A2_2 in B and A3_3 in B:
     print(a)
elif A1_3 in B and A2_2 in B and A3_1 in B:
    print(a)
else:
    print(b)

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())
N =int(input())
B = []
for _ in range(N):
    B.append(int(input()))

a=str('Yes')
b=str('No')
if A1_1 in B and A1_2 in B and A1_3 in B:
     print(a)
elif A2_1 in B and A2_2 in B and A2_3 in B:
    print(a)
elif A3_1 in B and A3_2 in B and A3_3 in B:
     print(a)
elif A1_1 in B and A2_1 in B and A3_1 in B:
    print(a)
elif A1_2 in B and A2_2 in B and A3_2 in B:
    print(a)
elif A1_3 in B and A2_3 in B and A3_3 in B:
    print(a)
elif A1_1 in B and A2_2 in B and A3_3 in B:
     print(a)
elif A1_3 in B and A2_2 in B and A3_1 in B:
    print(a)
else:
    print(b)
Buggy code:
# -*- coding: utf-8 -*-
"""
Created on Tue Mar  3 22:38:51 2020

@author: Kanaru Sato
"""

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

N = int(input())

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

flag = [[0, 0, 0]
        [0, 0, 0]
        [0, 0, 0]]

for i in range(0,3):
    for j in range(0,3):
        if A[i][j] in b:
            flag[i][j] = 1

column = 0
raw = 0
naname = 0

for i in range(0,3):
    column += flag[i][0]*flag[i][1]*flag[i][2]
    raw += flag[0][i]*flag[1][i]*flag[2][i]
naname = flag[0][0]*flag[1][1]*flag[2][2]+flag[0][2]*flag[1][1]*flag[2][0]

if column>=1 or raw>=1 or naname>=1:
    print("Yes")
else:
    print("No")

Fixed code:
# -*- coding: utf-8 -*-
"""
Created on Tue Mar  3 22:38:51 2020

@author: Kanaru Sato
"""

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

N = int(input())

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

flag = [[0, 0, 0],
        [0, 0, 0],
        [0, 0, 0]]

for i in range(0,3):
    for j in range(0,3):
        if A[i][j] in b:
            flag[i][j] = 1

column = 0
raw = 0
naname = 0

for i in range(0,3):
    column += flag[i][0]*flag[i][1]*flag[i][2]
    raw += flag[0][i]*flag[1][i]*flag[2][i]
naname = flag[0][0]*flag[1][1]*flag[2][2]+flag[0][2]*flag[1][1]*flag[2][0]


if column>=1 or raw>=1 or naname>=1:
    print("Yes")
else:
    print("No")
Buggy code:
import itertools
import sys

[a,b,c] = [int(x) for x in input().split()]
[d,e,f] = [int(x) for x in input().split()]
[g,h,i] = [int(x) for x in input().split()]
N = int(input())
num_list = []
for i in range(N):
  n = int(input())
  num_list.append(n)
set_list = [{a,b,c},{d,e,f},{g,h,i},{a,d,g},{b,e,h},{c,f,i},{a,e,i}]
the_set = set(num_list) & set([a,b,c,d,e,f,g,h,i])
v = itertools.permutations(the_set,3)
for i in v:
  if i in set_list:
    print('Yes')
    sys.exit()
print('No')


Fixed code:
import itertools
import sys

[a,b,c] = [int(x) for x in input().split()]
[d,e,f] = [int(x) for x in input().split()]
[g,h,i] = [int(x) for x in input().split()]
N = int(input())
num_list = []
for j in range(N):
  n = int(input())
  num_list.append(n)

set_list = [{a,b,c},{d,e,f},{g,h,i},{a,d,g},{b,e,h},{c,f,i},{a,e,i},{c,e,g}]
the_set = set(num_list) & set([a,b,c,d,e,f,g,h,i])

v = itertools.permutations(the_set,3)
for k in v:
  if set(k) in set_list:
    print('Yes')
    sys.exit()
print('No')
Buggy code:
def check_h(a):
    for row in a:
        if row == [0, 0, 0]:
            return True


def check_v(a):
    for col in range(3):
        if [row[col] for row in a] == [0, 0, 0]:
            return True


def check_c(a):
    if [a[i][i] for i in range(3)] == [0, 0, 0] or [a[i][2 - i] for i in range(3)] == [0, 0, 0]:
        return True


def resolve():
    A = [list(map(int, input().split())) for _ in range(3)]
    N = int(input())
    for _ in range(N):
        B = int(input())
        mark(A, B)
    if check_h(A) or check_v(A) or check_c(A):
        print("Yes")
    else:
        print("No")
resolve()

Fixed code:
def mark(a, b):
    for i in range(3):
        for j in range(3):
            if a[i][j] == b:
                a[i][j] = 0


def check_h(a):
    for row in a:
        if row == [0, 0, 0]:
            return True


def check_v(a):
    for col in range(3):
        if [row[col] for row in a] == [0, 0, 0]:
            return True


def check_c(a):
    if [a[i][i] for i in range(3)] == [0, 0, 0] or [a[i][2 - i] for i in range(3)] == [0, 0, 0]:
        return True


def resolve():
    A = [list(map(int, input().split())) for _ in range(3)]
    N = int(input())
    for _ in range(N):
        B = int(input())
        mark(A, B)
    if check_h(A) or check_v(A) or check_c(A):
        print("Yes")
    else:
        print("No")
resolve()
Buggy code:
a = [list(map(int, input().split())) for i in range(3)]
 
num = int(input())
for i in range(num):
  now = int(input())
  for i in range(3):
    for j in range(3):
      if(a[i][j] == now):
        a[i][j] = 0
        
for i in range(3):
  if(a[i][0] == 0 and a[i][1] == 0 and a[i][2] == 0):
    ans = 'yes'
  if(a[0][i] == 0 and a[1][i] == 0 and a[2][i] == 0):
    ans = 'yes'
    
if(a[0][0] == 0 and a[1][1] == 0 and a[2][2] == 0):
  ans = 'yes'
if(a[0][2] == 0 and a[1][1] == 0 and a[2][0] == 0):
  ans = 'yes'

print(ans)

Fixed code:
a = [list(map(int, input().split())) for i in range(3)]
 
num = int(input())
for i in range(num):
  now = int(input())
  for i in range(3):
    for j in range(3):
      if(a[i][j] == now):
        a[i][j] = 0
ans = 'No'        
for i in range(3):
  if(a[i][0] == 0 and a[i][1] == 0 and a[i][2] == 0):
    ans = 'Yes'
  if(a[0][i] == 0 and a[1][i] == 0 and a[2][i] == 0):
    ans = 'Yes'
    
if(a[0][0] == 0 and a[1][1] == 0 and a[2][2] == 0):
  ans = 'Yes'
if(a[0][2] == 0 and a[1][1] == 0 and a[2][0] == 0):
  ans = 'Yes'

print(ans)
Buggy code:
def checkbingo(bingo,bs):
  for b in bingo:
    cnt = 0
    for n in bs:
      if n in b:
        cnt +=1
    if cnt == 3:
      return True
  return False

list1 = input('').split(' ')
list2 = input('').split(' ')
list3 = input('').split(' ')
bingo = [list1,list2,list3]
for i in range(0,2):
  bingo.append([list1[i],list2[i],list3[i]])
bingo.append([list1[0],list1[1],list2[2]])
bingo.append([list1[2],list1[1],list2[0]])
max_n = int(input(''))
bs = []
result = False
for n in range(0,max_n):
  b = input('')
  bs.append(b)
if checkbingo(bingo,bs):
  result = True

if result == True:
    print("Yes")
else:
    print("No")



Fixed code:
def checkbingo(bingo,bs):
  for b in bingo:
    cnt = 0
    for n in bs:
      if n in b:
        cnt +=1
    if cnt == len(b):
      return True
  return False

list1 = input('').split(' ')
list2 = input('').split(' ')
list3 = input('').split(' ')
bingo = [list1,list2,list3]
bingo.append([list1[0],list2[0],list3[0]])
bingo.append([list1[1],list2[1],list3[1]])
bingo.append([list1[2],list2[2],list3[2]])
bingo.append([list1[0],list2[1],list3[2]])
bingo.append([list1[2],list2[1],list3[0]])
max_n = int(input(''))
bs = []
result = False
for n in range(0,max_n):
  bs.append(input(''))

if checkbingo(bingo,bs):
    print("Yes")
else:
    print("No")
Buggy code:
B=[]
for i in range(3):
    A=list(map(int,input().split()))
    B.append(A[0])
    B.append(A[1])
    B.append(A[2])
N=int(input())
for j in range(N):
    b=int(input())
    if b in B:
        B[B.index(b)]=0
if B[0],B[1],B[2]==0,0,0:
    print('Yes')
elif B[3],B[4],B[5]==0,0,0:
    print('Yes')
elif B[6],B[7],B[8]==0,0,0:
    print('Yes')
elif B[0],B[3],B[6]==0,0,0:
    print('Yes')
elif B[1],B[4],B[7]==0,0,0:
    print('Yes')
elif B[2],B[5],B[8]==0,0,0:
    print('Yes')
elif B[0],B[4],B[8]==0,0,0:
    print('Yes')
elif B[2],B[4],B[6]==0,0,0:
    print('Yes')
else:
    print('No')

Fixed code:
B=[]
for i in range(3):
    A=list(map(int,input().split()))
    B.append(A[0])
    B.append(A[1])
    B.append(A[2])
N=int(input())
for j in range(N):
    b=int(input())
    if b in B:
        B[B.index(b)]=0
if B[0]==0 and B[1]==0 and B[2]==0:
    print('Yes')
elif B[3]==0 and B[4]==0 and B[5]==0:
    print('Yes')
elif B[6]==0 and B[7]==0 and B[8]==0:
    print('Yes')
elif B[0]==0 and B[3]==0 and B[6]==0:
    print('Yes')
elif B[1]==0 and B[4]==0 and B[7]==0:
    print('Yes')
elif B[2]==0 and B[5]==0 and B[8]==0:
    print('Yes')
elif B[0]==0 and B[4]==0 and B[8]==0:
    print('Yes')
elif B[2]==0 and B[4]==0 and B[6]==0:
    print('Yes')
else:
    print('No')
Buggy code:
# input
A = []
A_append = A.append
for i in range(3):
    An = list(map(int, input().split()))
    A_append(An)
print(A)

N = int(input())

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

# check

marker = [[0 * 3], [0 * 3], [0 * 3]]
bingo_fl = False
for i in b:
    if b in A:
        n, m = A.index(b)
        marker[n][m] = 1

        if (
            [1 * 3] in [marker[i][:] for i in range(3)] or
            [1 * 3] in [[marker[0][i], marker[1][i], marker[2][i]] for i in range(3)] or
            [1 * 3] == [marker[0][0], marker[1][1], marker[2][2]] or
            [1 * 3] == [marker[0][2], marker[1][1], marker[2][0]]
        ):
            bingo_fl = True
            break

if bingo_fl is True:
    print("Yes")
else:
    print("No")

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

N = int(input())

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

# check

marker = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]

bingo_fl = False
for i in b:
    for n, An in enumerate(A):

        if i in An:
            m = An.index(i)

            marker[n][m] = 1

            break

if (
        [1, 1, 1] in [marker[i][:] for i in range(3)] or
        [1, 1, 1] in [[marker[0][i], marker[1][i], marker[2][i]] for i in range(3)] or
        [1, 1, 1] == [marker[0][0], marker[1][1], marker[2][2]] or
        [1, 1, 1] == [marker[0][2], marker[1][1], marker[2][0]]
):
    bingo_fl = True

if bingo_fl is True:
    print("Yes")
else:
    print("No")
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

for i in range(3):
    flag=True
    for j in range(3):
        if a[i][j]!=0:
            flag=False
    if flag:
        print("Yes")
        exit()

for i in range(3):
    flag=True
    for j in range(3):
        if a[j][i]!=0:
            flag=False
    if flag:
        print("Yes")
        exit()

for i in range(3):
    flag=True
    if a[i][i]!=0:
        flag=False
if flag:
    print("Yes")
    exit()

for i in range(3):
    if a[i][3-i]!=0:
        print("No")
        exit()
print("Yes")
exit()

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
 
for i in range(3):
    flag=True
    for j in range(3):
        if a[i][j]!=0:
            flag=False
    if flag:
        print("Yes")
        exit()
 
for i in range(3):
    flag=True
    for j in range(3):
        if a[j][i]!=0:
            flag=False
    if flag:
        print("Yes")
        exit()

flag=True
for i in range(3):
    if a[i][i]!=0:
        flag=False
if flag:
    print("Yes")
    exit()
 
for i in range(3):
    if a[i][2-i]!=0:
        print("No")
        exit()
print("Yes")
exit()
Buggy code:
a1,a2,a3,_,*b = [i.split() for i in open(0)]
bingo = [[0, 1, 2], [3, 4, 5], [6, 7, 8], [2, 5, 8], [0, 3, 6], [1, 4, 7], [0, 4, 8], [2, 4, 6]]
s = ["" if i in b else i for i in a1 + a2 + a3]
for i,j,k in bingo:
    if {s[i],s[j],s[k]} ==  {''}:
        print('Yes')
        exit()
print('No')

Fixed code:
a1,a2,a3,_,*b = [i.split() for i in open(0)]
bingo = [[0, 1, 2], [3, 4, 5], [6, 7, 8], [2, 5, 8], [0, 3, 6], [1, 4, 7], [0, 4, 8], [2, 4, 6]]
s = ["" if i in sum(b,[]) else i for i in a1 + a2 + a3]
for i,j,k in bingo:
    if {s[i],s[j],s[k]} ==  {''}:
        print('Yes')
        exit()
print('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 = [0] * N 
for i in range(N):
    b[i] = int(input())
A = [A1,A2,A3]
B = [[0]*3,[0]*3,[0]*3]
for i in range(3):
    for j in range(3):
        for k in range(N):
            if A[i][j] == b[k]:
                B[i][j] = 1
if B[0] == [1,1,1]:
    print("Yes")
elif B[1] == [1,1,1]:
    print("Yes")
elif B[2] == [1,1,1]:
    print("Yes")
elif B[0][0] == 1 and B[1][0] == 1 and B[2][0] == 1:
    print("Yes")
elif B[0][1] == 1 and B[1][1] == 1 and B[2][1] == 1:
    print("Yes")
elif B[0][2] == 1 and B[1][2] == 1 and B[2][2] == 1:
    print("Yes")
elif B[0][0] == 1 and B[1][1] == 1 and B[2][2] == 1:
    print("Yes")
elif B[0][2] == 1 and B[1][1] == 1 and B[2][0] == 1:
    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 = [0] * N 
for i in range(N):
    b[i] = int(input())
A = [A1,A2,A3]
B = [[0]*3,[0]*3,[0]*3]
for i in range(3):
    for j in range(3):
        for k in range(N):
            if A[i][j] == b[k]:
                B[i][j] = 1
if B[0] == [1,1,1]:
    print("Yes")
elif B[1] == [1,1,1]:
    print("Yes")
elif B[2] == [1,1,1]:
    print("Yes")
elif B[0][0] == 1 and B[1][0] == 1 and B[2][0] == 1:
    print("Yes")
elif B[0][1] == 1 and B[1][1] == 1 and B[2][1] == 1:
    print("Yes")
elif B[0][2] == 1 and B[1][2] == 1 and B[2][2] == 1:
    print("Yes")
elif B[0][0] == 1 and B[1][1] == 1 and B[2][2] == 1:
    print("Yes")
elif B[0][2] == 1 and B[1][1] == 1 and B[2][0] == 1:
    print("Yes")
else:
    print("No")