qyliang/CodeNanoFix huggingface dataset:
Buggy code:
def B():
    a = [list(map(int,input().split())) for i in range(3)]
    n = int(input())
    b = [list(map(int,input().split())) for i in range(n)]
    for bingo in b:
        for i in range(3):
            for j in range(3):
                if a[i][j] == bingo:
                    a[i][j] = 0
    if (a[0][0] == a[1][1] == a[2][2] == 0) or (a[0][2] == a[1][1] == a[2][0] == 0):
        print("Yes")
        return
    for i in range(3):
        if (a[i][0] == a[i][1] == a[i][2] == 0) or (a[0][i] == a[1][i] == a[2][i] == 0):
            print("Yes")
            return
    print("No")
B()

Fixed code:
def B():
    a = [list(map(int,input().split())) for i in range(3)]
    n = int(input())
    #b = [list(map(int,input().split())) for i in range(n)]
    for bingo in  (int(input()) for _ in range(n)):
        for i in range(3):
            for j in range(3):
                if a[i][j] == bingo:
                    a[i][j] = 0
    if (a[0][0] == a[1][1] == a[2][2] == 0) or (a[0][2] == a[1][1] == a[2][0] == 0):
        print("Yes")
        return
    for i in range(3):
        if (a[i][0] == a[i][1] == a[i][2] == 0) or (a[0][i] == a[1][i] == a[2][i] == 0):
            print("Yes")
            return
    print("No")
B()
Buggy code:
def B():
    mat = [list(map(int,input().split())) for i in range(3)]
    n = int(input())
    b = [list(map(int,input().split())) for i in range(n)]
    for bingo in b:
        for i in range(3):
            for j in range(3):
                if mat[i][j] == bingo:
                    mat[i][j] = 0
for i in range(3):
    if all(mat[i][j] == 0 for j in range(3)):
        print('Yes')
        break
    if all(mat[j][i] == 0 for j in range(3)):
        print('Yes')
        break
else:
    if mat[0][0] == mat[1][1] == mat[2][2] == 0 or\
            mat[0][2] == mat[1][1] == mat[2][0] == 0:
        print('Yes')
    else:
        print('No')
B()

Fixed code:
def B():
    mat = [list(map(int,input().split())) for i in range(3)]
    n = int(input())
    #b = [list(map(int,input().split())) for i in range(n)]
    for bingo in  (int(input()) for _ in range(n)):
        for i in range(3):
            for j in range(3):
                if mat[i][j] == bingo:
                    mat[i][j] = 0
    for i in range(3):
        if all(mat[i][j] == 0 for j in range(3)):
            print('Yes')
            break
        if all(mat[j][i] == 0 for j in range(3)):
            print('Yes')
            break
    else:
        if mat[0][0] == mat[1][1] == mat[2][2] == 0 or\
                mat[0][2] == mat[1][1] == mat[2][0] == 0:
            print('Yes')
        else:
            print('No')
B()
Buggy code:
import sys

bingo=[]

for _ in range(3):
  bingo.append(list(map(int, input().split())))

n=int(input())

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

print(bingo)

for i in range(3):
  if bingo[i][0]==0 & bingo[i][1]==0 & bingo[i][2]==0:
    print('Yes')
    sys.exit()
  if bingo[0][i]==0 & bingo[1][i]==0 & bingo[2][i]==0:
    print('Yes')
    sys.exit()

if bingo[0][0]==0 & bingo[1][1]==0 & bingo[2][2]==0:
  print('Yes')
  sys.exit()

if bingo[0][2]==0 & bingo[1][1]==0 & bingo[2][0]==0:
  print('Yes')
  sys.exit()

print('No')

Fixed code:
import sys

bingo=[]

for _ in range(3):
  bingo.append(list(map(int, input().split())))

n=int(input())

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

#print(bingo)

for i in range(3):
  if (bingo[i][0]==0) & (bingo[i][1]==0) & (bingo[i][2]==0):
    print('Yes')
    sys.exit()
  
  if (bingo[0][i]==0) & (bingo[1][i]==0) & (bingo[2][i]==0):
    print('Yes')
    sys.exit()

if (bingo[0][0]==0) & (bingo[1][1]==0) & (bingo[2][2]==0):
  print('Yes')
  sys.exit()

if (bingo[0][2]==0) & (bingo[1][1]==0) & (bingo[2][0]==0):
  print('Yes')
  sys.exit()

print('No')
Buggy code:
a = [list(map(int,input().split())) for _ in range(3)]
N = int(input())
b = [int(input()) for _ in range(N)]

for i in range(3):
  for j in range(3):
    if a[i][j] == b:
      a[i][j] = 0
      
ans = 'No'
for i in range(3):
  if sum(a[i]) == 0:
    ans = 'Yes'
    break
  if a[i][0]+a[i][1]+a[i][2] == 0:
    ans = 'Yes'
    break

if a[0][0]+a[1][1]+a[2][2] == 0 or a[0][2]+a[1][1]+a[2][0] == 0:
    ans = 'Yes'

print(ans)

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


for i in range(len(b)):
  for j in range(3):
    for k in range(3):
      if a[j][k] == b[i]:
        a[j][k] = 0
      
ans = 'No'
for i in range(3):
  if a[i][0]+a[i][1]+a[i][2] == 0:
    ans = 'Yes'
    break
  if a[0][i]+a[1][i]+a[2][i] == 0:
    ans = 'Yes'
    break

if a[0][0]+a[1][1]+a[2][2] == 0 or a[0][2]+a[1][1]+a[2][0] == 0:
    ans = 'Yes'

print(ans)
Buggy code:
a1=[map(int(),input().split())]
a2=[map(int(),input().split())]
a3=[map(int(),input().split())]
n=int(input())
b=[input() for i in range(n)]
for i in range(3):
    for j in range(n):
        if a1[i] == b[j]:
            a1[i] = 1
        elif a2[i] == b[j]:
            a2[i] = 1
        elif a3[i] == b[j]:
            a3[i] = 1
 
if a1[0] == a1[1] == a1[2]:
    print("Yes")
elif a2[0] == a2[1] == a2[2]:
    print("Yes")
elif a3[0] == a3[1] == a3[2]:
    print("Yes")
elif a1[0] == a2[0] == a3[0]:
    print("Yes")
elif a1[1] == a2[1] == a3[1]:
    print("Yes")
elif a1[2] == a2[2] == a3[2]:
    print("Yes")
elif a1[0] == a2[1] == a3[2]:
    print("Yes")
elif a1[2] == a2[1] == a3[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)]
for i in range(3):
    for j in range(n):
        if a1[i] == b[j]:
            a1[i] = 1
        elif a2[i] == b[j]:
            a2[i] = 1
        elif a3[i] == b[j]:
            a3[i] = 1
 
if a1[0] == a1[1] == a1[2]:
    print("Yes")
elif a2[0] == a2[1] == a2[2]:
    print("Yes")
elif a3[0] == a3[1] == a3[2]:
    print("Yes")
elif a1[0] == a2[0] == a3[0]:
    print("Yes")
elif a1[1] == a2[1] == a3[1]:
    print("Yes")
elif a1[2] == a2[2] == a3[2]:
    print("Yes")
elif a1[0] == a2[1] == a3[2]:
    print("Yes")
elif a1[2] == a2[1] == a3[0]:
    print("Yes")
else:
    print("No")
Buggy code:
import sys
rl = sys.stdin.readline

rows = 3
cols = 3
a11,a12,a13 = [int(x) for x in rl().split(' ')]
a11,a12,a13 = [int(x) for x in rl().split(' ')]
a31,a32,a33 = [int(x) for x in rl().split(' ')]

n = int(rl())
b = []

for i in range(n):
    b.append(int(rl()))

#####################

card = [a11,a12,a13,a1,a22,a23,a31,a32,a33]

for num in b:
    for i in range(len(card)):
        if card[i] == num:
            card[i] = 0

def check(card):
    for y in range(rows):
        if all([card[y*rows+x] == 0 for x in range(cols)]):
            return True

    # col
    for x in range(cols):
        if all([card[y*rows+x] == 0 for y in range(rows)]):
            return True

    # diagonal
    if all([card[xy*rows+xy] == 0 for xy in range(rows)]):
            return True

    if all([card[xy*rows+cols-1-xy] == 0 for xy in range(rows)]):
            return True

    return False

if check(card):
    print("Yes")
else:
    print("No")


Fixed code:
import sys
rl = sys.stdin.readline

rows = 3
cols = 3
a11,a12,a13 = [int(x) for x in rl().split(' ')]
a21,a22,a23 = [int(x) for x in rl().split(' ')]
a31,a32,a33 = [int(x) for x in rl().split(' ')]

n = int(rl())
b = []

for i in range(n):
    b.append(int(rl()))

#####################

card = [a11,a12,a13,a21,a22,a23,a31,a32,a33]

for num in b:
    for i in range(len(card)):
        if card[i] == num:
            card[i] = 0


def check(card):
    for y in range(rows):
        if all([card[y*rows+x] == 0 for x in range(cols)]):
            return True

    # col
    for x in range(cols):
        if all([card[y*rows+x] == 0 for y in range(rows)]):
            return True

    # diagonal
    if all([card[xy*rows+xy] == 0 for xy in range(rows)]):
            return True

    if all([card[xy*rows+cols-1-xy] == 0 for xy in range(rows)]):
            return True

    return False


if check(card):
    print("Yes")
else:
    print("No")
Buggy code:

ls_a = []
for i in range(3):
    ls_a.extend(list(map(int,input().split())))
n = int(input())
ls_b = [int(input()) for i in range(n)]

for i in range(9):
    if ls_a[i] in ls_b:
        ls_a[i] = 0

print(ls_a,ls_b)
for i in range(3):
    if ls_a[i] == 0 and ls_a[i+3] == 0 and ls_a[i+6] == 0:
        print("Yes")
        exit()
    if ls_a[i*3] == 0 and ls_a[i*3+1] == 0 and ls_a[i*3+2] == 0:
        print("Yes")
        exit()
if ls_a[0] == 0 and ls_a[4] == 0 and ls_a[8] == 0:
    print("Yes")
    exit()
if ls_a[2] == 0 and ls_a[4] == 0 and ls_a[6] == 0:
    print("Yes")
    exit()
print("No")
            

Fixed code:

ls_a = []
for i in range(3):
    ls_a.extend(list(map(int,input().split())))
n = int(input())
ls_b = [int(input()) for i in range(n)]

for i in range(9):
    if ls_a[i] in ls_b:
        ls_a[i] = 0

for i in range(3):
    if ls_a[i] == 0 and ls_a[i+3] == 0 and ls_a[i+6] == 0:
        print("Yes")
        exit()
    if ls_a[i*3] == 0 and ls_a[i*3+1] == 0 and ls_a[i*3+2] == 0:
        print("Yes")
        exit()
if ls_a[0] == 0 and ls_a[4] == 0 and ls_a[8] == 0:
    print("Yes")
    exit()
if ls_a[2] == 0 and ls_a[4] == 0 and ls_a[6] == 0:
    print("Yes")
    exit()
print("No")
Buggy code:
import sys
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):
    ans = True
    for j in range(3):
        if a[i][j] not in b:
            ans = False
    if ans:
        print("Yes")
        sys.exit()
for j in range(3):
    ans = True
    for i in range(3):
        if a[i][j]  not in b:
            ans = False
    if ans:
        print("Yes")
        sys.exit()
if all([a[0][2] in b, a[1][1] in b, a[2][2] in b]) or all([a[0][2] in b, a[1][1] in b, a[2][0] in b]):
    print("Yes")
    sys.exit()

print("No")


Fixed code:
import sys
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):
    ans = True
    for j in range(3):
        if a[i][j] not in b:
            ans = False
    if ans:
        print("Yes")
        sys.exit()
for j in range(3):
    ans = True
    for i in range(3):
        if a[i][j]  not in b:
            ans = False
    if ans:
        print("Yes")
        sys.exit()
if all([a[0][0] in b, a[1][1] in b, a[2][2] in b]) or all([a[0][2] in b, a[1][1] in b, a[2][0] in b]):
    print("Yes")
    sys.exit()

print("No")
Buggy code:
import sys
bingo_size = 3
a = []
an = set()
for _ in range(3):
  a.append(list(map(int, input().split())))
  for i in a[_]:
    an.add(i)

n = int(input())
b = set()
for _ in range(n):
  bi = int(input())
  if bi in an:
    b.add(bi)

for hi in range(3):
  ok = True
  for _ in range(3):
    if a[hi][_] not in b:
      ok = false
      break
    if ok:
      print("Yes")
      sys.exit()

for wi in range(3):
  ok = True
  for _ in range(3):
    if a[_][wi] not in b:
      ok = False
      break
  if ok:
    print("Yes")
    sys.exit()

if all([a[0][0] in b, a[1][1] in b, a[2][2] in b]) or all([a[0][2] in b, a[1][1] in b, a[2][0] in b]):
           print("Yes")
           sys.exit()
           
print("No")   

Fixed code:
import sys
bingo_size = 3
a = []
an = set()
for _ in range(3):
  a.append(list(map(int, input().split())))

n = int(input())
b = set()
for _ in range(n):
  bi = int(input())
  b.add(bi)

for hi in range(3):
  ok = True
  for _ in range(3):
    if a[hi][_] not in b:
      ok = False
      
  if ok:
    print("Yes")
    sys.exit()

for wi in range(3):
  ok = True
  for _ in range(3):
    if a[_][wi] not in b:
      ok = False
      
  if ok:
    print("Yes")
    sys.exit()

if all([a[0][0] in b, a[1][1] in b, a[2][2] in b]) or all([a[0][2] in b, a[1][1] in b, a[2][0] in b]):
           print("Yes")
           sys.exit()
           
print("No")
Buggy code:
mat=[list(map(int,input().split())) for i in range(3)]
print(mat)
N=int(input())
c=0
for n in range(N):
  b=int(input())
  for i in range(3):
    for j in range(3):
      if mat[i][j]==b:
        mat[i][j]=0
for i in range(3):
  if mat[i][0]==0 and mat[i][1]==0 and mat[i][2]==0:
    c+=1
  elif mat[0][i]==0 and mat[1][i]==0 and mat[2][i]==0:
    c+=1
  elif mat[0][0]==0 and mat[1][1]==0 and mat[2][2]==0:
    c+=1
  elif mat[0][2]==0 and mat[1][1]==0 and mat[2][0]==0:
    c+=1

if c >= 1:
  print("Yes")
else:
  print("No")

Fixed code:
mat=[list(map(int,input().split())) for i in range(3)]
N=int(input())
c=0
for n in range(N):
  b=int(input())
  for i in range(3):
    for j in range(3):
      if mat[i][j]==b:
        mat[i][j]=0
for i in range(3):
  if mat[i][0]==0 and mat[i][1]==0 and mat[i][2]==0:
    c+=1
  elif mat[0][i]==0 and mat[1][i]==0 and mat[2][i]==0:
    c+=1
  elif mat[0][0]==0 and mat[1][1]==0 and mat[2][2]==0:
    c+=1
  elif mat[0][2]==0 and mat[1][1]==0 and mat[2][0]==0:
    c+=1

if c >= 1:
  print("Yes")
else:
  print("No")
Buggy code:
bingo = []
sheet = set()
for _ in range(3):
  lst = [int(i) for i in input().split()]
  bingo.append(lst)
n = int(input())
for _ in range(n):
  a = int(input())
  for i in range(3):
    for j in range(3):
      if bingo[i][j] == a:
        num = 3 * i + j
        sheet.add(num)
if 0 in sheet and 1 in sheet and 2 in sheet:
  print('Yes')
if 0 in sheet and 3 in sheet and 6 in sheet:
  print('Yes')
if 0 in sheet and 4 in sheet and 8 in sheet:
  print('Yes')
if 1 in sheet and 4 in sheet and 7 in sheet:
  print('Yes')
if 2 in sheet and 5 in sheet and 8 in sheet:
  print('Yes')
if 2 in sheet and 4 in sheet and 6 in sheet:
  print('Yes')
if 3 in sheet and 4 in sheet and 5 in sheet:
  print('Yes')
if 6 in sheet and 7 in sheet and 8 in sheet:
  print('Yes')
else:
  print('No')

Fixed code:
bingo = []
sheet = set()
for _ in range(3):
  lst = [int(i) for i in input().split()]
  bingo.append(lst)
n = int(input())
for _ in range(n):
  a = int(input())
  for i in range(3):
    for j in range(3):
      if bingo[i][j] == a:
        num = 3 * i + j
        sheet.add(num)
if 0 in sheet and 1 in sheet and 2 in sheet:
  print('Yes')
elif 0 in sheet and 3 in sheet and 6 in sheet:
  print('Yes')
elif 0 in sheet and 4 in sheet and 8 in sheet:
  print('Yes')
elif 1 in sheet and 4 in sheet and 7 in sheet:
  print('Yes')
elif 2 in sheet and 5 in sheet and 8 in sheet:
  print('Yes')
elif 2 in sheet and 4 in sheet and 6 in sheet:
  print('Yes')
elif 3 in sheet and 4 in sheet and 5 in sheet:
  print('Yes')
elif 6 in sheet and 7 in sheet and 8 in sheet:
  print('Yes')
else:
  print('No')
Buggy code:
a = []
[a.append(list(map(int, input().split()))) for _ in range(3)]
n = int(input())
b = [int(input())for _ in range(n)]
for i in b:
  for j in range(3):
    for k in range(3):
      if a[j][k] == i:
        a[j][k] = 1
ans = 0
count =0
for j in range(3):
  if a[j].count(1) == 3:
    ans += 1
  elif (a[0][j] == a[1][j] == a[2][j]) == 1:
    ans += 1
  elif (a[j][j] == a[j][j] == a[j][j]) == 1:
    ans += 1
  elif (a[0][2] == a[1][1] == a[2][1]) == 1:
    ans += 1
if ans > 0:
  print("Yes")
else:
  print("No")

Fixed code:
a = []
[a.append(list(map(int, input().split()))) for _ in range(3)]
n = int(input())
b = [int(input())for _ in range(n)]
for i in b:
  for j in range(3):
    for k in range(3):
      if a[j][k] == i:
        a[j][k] = 1
ans = 0
count =0
for j in range(3):
  if a[j].count(1) == 3:
    ans += 1
  elif (a[0][j] == a[1][j] == a[2][j]) == 1:
    ans += 1
  elif (a[0][0] == a[1][1] == a[2][2]) == 1:
    ans += 1
  elif (a[0][2] == a[1][1] == a[2][0]) == 1:
    ans += 1
if ans > 0:
  print("Yes")
else:
  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_list=[]
for i in range(N):
  b_list.append(int(input))

for i in b_list:
  A1 = [x in A1 if x != i else -1]
  A2 = [y in A2 if y != i else -1]
  A3 = [z in A3 if z != i else -1]

if sum(A1)==-3 or sum(A2)==-3 or sum(A3)==-3:
  print('Yes')
  exit()
for t in range(3)
  if A1[t]+A2[t]+A3[t] == -3:
    print('Yes')
    exit()
if A1[0]+A2[1]+A3[2] == -3 or A1[2]+A2[1]+A3[0] == -3:
  print('Yes')
  exit()
print('No')

Fixed code:
import sys
A1 = list(map(int,input().split()))
A2 = list(map(int,input().split()))
A3 = list(map(int,input().split()))
N = int(input())
b_list=[]
for i in range(N):
  b_list.append(int(input()))
 
for i in b_list:
  A1 = [x if x != i else -1 for x in A1]
  A2 = [y if y != i else -1 for y in A2]
  A3 = [z if z != i else -1 for z in A3]
 
if sum(A1)==-3 or sum(A2)==-3 or sum(A3)==-3:
  print('Yes')
  sys.exit()
for t in range(3):
  if A1[t]+A2[t]+A3[t] == -3:
    print('Yes')
    sys.exit()
if A1[0]+A2[1]+A3[2] == -3 or A1[2]+A2[1]+A3[0] == -3:
  print('Yes')
  sys.exit()
print('No')
Buggy code:
A = [list(map(int,input().split())) for i in range(3)]
N = int(input())
B = [int(input()) for i in range(N)]
ans = 0
for i in range(3):
  for j in range(3):
    for k in B:
      if A[i][j] == k:
        A[i][j] = 1
print(A)
for i in range(3):
  if A[i].count(1) == 3:
    ans += 1
  elif A[0][i] == 1 and A[2][i] == 1 and A[2][i] == 1:
    ans += 1
if A[0][0] == 1 and A[1][1] == 1 and A[2][2] == 1:
  ans += 1
elif A[0][2] == 1 and A[1][1] == 1 and A[2][0] == 1:
  ans += 1
elif ans > 1:
  print("Yes")
else:
  print("No")



Fixed code:
A = [list(map(int,input().split())) for i in range(3)]
N = int(input())
B = [int(input()) for i in range(N)]
ans = 0
for i in range(3):
  for j in range(3):
    for k in B:
      if A[i][j] == k:
        A[i][j] = 1
for i in range(3):
  if A[i].count(1) == 3:
    ans += 1
  elif A[0][i] == 1 and A[1][i] == 1 and A[2][i] == 1:
    ans += 1
  elif A[0][0] == 1 and A[1][1] == 1 and A[2][2] == 1:
    ans += 1
  elif A[0][2] == 1 and A[1][1] == 1 and A[2][0] == 1:
    ans += 1
if ans > 0:
  print("Yes")
else:
  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_lst = [int(input()) for _ in range(n)]
a_lst = a1 + a2 + a3

for i in range(len(b_lst)):
    if b_lst[i] in a_lst:
        a_lst[a_lst.index(b_lst[i])] = 0

for i in range(3):
    if a_lst[i] == a_lst[i+3] == a_lst[i+6] == 0:
        print("Yes")
        break
    elif a_lst[3*i] == a_lst[3*i+1] == a_lst[3*i+2] == 0:
        print("Yes")
        break
    elif a_lst[2] == a_lst[4] == a_lst[6] == 0 or a_lst[0] == a_lst[4] == a_lst[8] == 0:
        print("Yes")
        break
    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_lst = [int(input()) for _ in range(n)]
a_lst = a1 + a2 + a3

for i in range(len(b_lst)):
    if b_lst[i] in a_lst:
        a_lst[a_lst.index(b_lst[i])] = 0

ans = 0

for i in range(3):
    if a_lst[i] == a_lst[i+3] == a_lst[i+6] == 0:
        print("Yes")
        ans = 1
        break
    elif a_lst[3*i] == a_lst[3*i+1] == a_lst[3*i+2] == 0:
        print("Yes")
        ans = 1
        break
    elif a_lst[2] == a_lst[4] == a_lst[6] == 0 or a_lst[0] == a_lst[4] == a_lst[8] == 0:
        print("Yes")
        ans = 1
        break

if ans == 0:
    print("No")
Buggy code:
b=[]
c=[0]*9
for i in range(3):
  a=input().split()
  b.append(int(a[0]))
  b.append(int(a[1]))
  b.append(int(a[2]))
N=int(input())
for i in range(N):
  e=int(input())
  for j in range(9):
    if(e==b[j]):
      c[j]=1
if(c[0]==c[1]==c[2]):
  print('Yes')
elif(c[3]==c[4]==c[5]):
  print('Yes')
elif(c[6]==c[7]==c[8]):
  print('Yes')
elif(c[0]==c[4]==c[8]):
  print('Yes')
elif(c[2]==c[4]==c[6]):
  print('Yes')
else:
  print('No')

Fixed code:
b=[]
c=[0]*9
for i in range(3):
  a=input().split()
  b.append(int(a[0]))
  b.append(int(a[1]))
  b.append(int(a[2]))
N=int(input())
for i in range(N):
  e=int(input())
  for j in range(9):
    if(e==b[j]):
      c[j]=1
if(c[0]==c[1]==c[2]==1):
  print('Yes')
elif(c[3]==c[4]==c[5]==1):
  print('Yes')
elif(c[6]==c[7]==c[8]==1):
  print('Yes')
elif(c[0]==c[4]==c[8]==1):
  print('Yes')
elif(c[2]==c[4]==c[6]==1):
  print('Yes')
elif(c[0]==c[3]==c[6]==1):
  print('Yes')
elif(c[1]==c[4]==c[7]==1):
  print('Yes')
elif(c[2]==c[5]==c[8]==1):
  print('Yes')
else:
  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 = [int(input()) for _ in range(N)]

for i in range(N):
  if b[i] in A1:
    if len(list(set(A1))) == 1:
      A1 = [0] * 3
    else:
      A1[A1.index(b[i])] = 0
  elif b[i] in A2:
    if len(list(set(A2))) == 1:
      A2 = [0] * 3
    else:
      A2[A2.index(b[i])] = 0
  elif b[i] in A3:
    if len(list(set(A3))) == 1:
      A3 = [0] * 3
    else:
      A3[A3.index(b[i])] = 0


if A1[0] == 0 and A1[0] == A2[0] == A3[0]:
  ans = "Yes"
elif A1[1] == 0 and A1[1] == A2[1] == A3[1]:
  ans = "Yes"
elif A1[2] == 0 and A1[2] == A2[2] == A3[2]:
  ans = "Yes"
elif A1[0] == 0 and A1[0] == A2[1] == A3[2]:
  ans = "Yes"
elif A1[2] == 0 and A1[2] == A2[1] == A3[0]:
  ans = "Yes"
elif A[0] == [0] * 3 or A[1] == [0] * 3 or A[2] == [0] * 3:
  ans = "Yes"
else:
  ans = "No"

print(ans)

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 _ in range(N)]

for i in range(N):
  if b[i] in A1:
    if len(list(set(A1))) == 1:
      A1 = [0] * 3
    else:
      A1[A1.index(b[i])] = 0
  elif b[i] in A2:
    if len(list(set(A2))) == 1:
      A2 = [0] * 3
    else:
      A2[A2.index(b[i])] = 0
  elif b[i] in A3:
    if len(list(set(A3))) == 1:
      A3 = [0] * 3
    else:
      A3[A3.index(b[i])] = 0


if A1[0] == 0 and A1[0] == A2[0] == A3[0]:
  ans = "Yes"
elif A1[1] == 0 and A1[1] == A2[1] == A3[1]:
  ans = "Yes"
elif A1[2] == 0 and A1[2] == A2[2] == A3[2]:
  ans = "Yes"
elif A1[0] == 0 and A1[0] == A2[1] == A3[2]:
  ans = "Yes"
elif A1[2] == 0 and A1[2] == A2[1] == A3[0]:
  ans = "Yes"
elif A1 == [0] * 3 or A2 == [0] * 3 or A3 == [0] * 3:
  ans = "Yes"
else:
  ans = "No"

print(ans)
Buggy code:
p,r=input,range
A=sum([list(map(int,p().split()))for _ in r(3)],[])
b=[int(p())for _ in r(int(p()))]
print('YNeos'[[v for v in[7,56,73,84,146,273,292,448]if sum(1<<i for i in r(9)if A[i]in b)&v==v]::2])

Fixed code:
p,r=input,range
A=sum([list(map(int,p().split()))for _ in r(3)],[])
b=[int(p())for _ in r(int(p()))]
print('YNeos'[all([sum(1<<i for i in r(9)if A[i]in b)&v!=v for v in[7,56,73,84,146,273,292,448]])::2])
Buggy code:
A=sum([list(map(int,input().split())) for _ in range(3)],[])
N=int(input())
b=[int(input()) for _ in range(N)]
f=0
for i in range(9):if A[i]in b:f|=1<<i
print('Yes'if sum(f&v==v for v in[7,23,56,84,146,273,292,448])else'No')

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

f=0
for i in range(9):
	if A[i]in b:f|=1<<i
ans=[v for v in [7,56,73,84,146,273,292,448]if f&v==v]
print('Yes' if ans else 'No')
Buggy code:
A = [list(map(int, input().split())) for _ in range(3)]
N = int(input())
b = [int(input()) for _ in range(N)]

field = 0
for v in b:
	for i in range(9):
		if A[i // 3][i % 3] == v:
			f|=1<<i
ans = 0
for v in [7,56,73,84,146,273,292,448]:
  ans |= f&v==v;
print('Yes' if ans else 'No')


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

f=0
for v in b:
	for i in range(9):
		if A[i // 3][i % 3] == v:
			f|=1<<i
ans = 0
for v in [7,56,73,84,146,273,292,448]:
  ans |= f&v==v;
print('Yes' if ans else 'No')