qyliang/CodeNanoFix huggingface dataset:
Buggy code:
a = [list(map(int, input().split())) for _ in range(3)]
n = int(input())
b = [int(input() for _ in range(n))]

flag = False
for i in range(3):
    if a[i][0] in b and a[i][1] in b and a[i][2] in b:
        flag = True
        break
    if a[0][i] in b and a[1][i] in b and a[2][i] in b:
        flag = True
        break
if a[0][0] in b and a[1][1] in b and a[2][2] in b:
    flag = True
if a[2][0] in b and a[1][1] in b and a[0][2] in b:
    flag = True
    
print("Yes" if flag else "No")

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

flag = False
for i in range(3):
    if a[i][0] in b and a[i][1] in b and a[i][2] in b:
        flag = True
        break
    if a[0][i] in b and a[1][i] in b and a[2][i] in b:
        flag = True
        break
if a[0][0] in b and a[1][1] in b and a[2][2] in b:
    flag = True
if a[2][0] in b and a[1][1] in b and a[0][2] in b:
    flag = True
    
print("Yes" if flag else "No")
Buggy code:
import numpy as np

a = [list(map(int, input().split())) for _ in range(3)]
a = np.array(a)
n = int(input())

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

at = a.transpose()
flag = True
for i in range(3):
    if sum(a[:][i]) == 0 or sum(at[:][i] == 0):
        flag = True
        break
diag = a[0][0] + a[1][1] + a[2][2]
diag2 = a[2][0] + a[1][1] + a[0][2]
if diag == 0 or diag2 == 0:
    flag = True

print("Yes" if flag else "No")

Fixed code:
import numpy as np

a = [list(map(int, input().split())) for _ in range(3)]
a = np.array(a)
n = int(input())

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

at = a.transpose()
flag = False
for i in range(3):
    if sum(a[:][i]) == 0 or sum(at[:][i]) == 0:
        flag = True
        break
diag = a[0][0] + a[1][1] + a[2][2]
diag2 = a[2][0] + a[1][1] + a[0][2]
if diag == 0 or diag2 == 0:
    flag = True

print("Yes" if flag else "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)]
set(b)

bingo = 0

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] = "o"     

for l in range(3):
  if a[l].count("o") == 3:
    bingo += 1
  if a[l][0] == a[l][1] == a[l][2] == "o":
    bingo += 1
if a[0][0] == a[1][1] == a[2][2] == "o":
  bingo += 1
if a[0][2] == a[1][1] == a[2][0] == "o":
  bingo += 1

if bingo > 0:
  print(bingo, "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)]
set(b)

bingo = 0
checker = 0

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] = "o"
        checker += 1

if checker > 0:       
  for l in range(3):
    if a[l].count("o") == 3:
      bingo += 1
    if a[0][l] == a[1][l] == a[2][l] == "o":
      bingo += 1
  if a[0][0] == a[1][1] == a[2][2] == "o":
    bingo += 1
  if a[0][2] == a[1][1] == a[2][0] == "o":
    bingo += 1
    
if bingo > 0:
  print("Yes")
else:
  print("No")
Buggy code:
A = [list(map(int, input().split())) for i in range(3)]
N = int(input())
b = []
for i in range(N):
	b.append(int(input()))
	
yoko = A
tate = [[], [], []]
for row in A:
	for i in range(3):
		tate[i].append(row[i])
naname = [[A[0][0], A[1][1], A[2][2]]]

all = yoko + tate + naname

y = 0
for kumi in all:
	chk = 0
	for i in range(3):
		for n in b:
			if kumi[i] == n:
				chk += 1
	if chk == 3:
		print("Yes")
		y = 1
	break

if y == 0:
	print("No")

Fixed code:
A = [list(map(int, input().split())) for i in range(3)]
N = int(input())
b = []
for i in range(N):
	b.append(int(input()))
	
yoko = A
tate = [[], [], []]
for row in A:
	for i in range(3):
		tate[i].append(row[i])
naname = [[A[0][0], A[1][1], A[2][2]], [A[0][2], A[1][1], A[2][0]]]

all = yoko + tate + naname

y = 0
chk = 0
for kumi in all:
	for k in kumi:
		if k in b:
			chk += 1
		else:
			continue
	if chk == 3:
		print("Yes")
		y = 1
		break
	else:
		chk = 0
		
if y == 0:
	print("No")
Buggy code:
bingo = [list(map(int, input().split())) for _ in range(3)]
N = int(input())
number = [int(input()) for _ in range(N)]

check = [0 for _ in range(3)]

for i in range(N):
  for j in range(3):
    for k in range(3):
      if bingo[j][k] == N[i]:
        check[j][k] = 1
        
ans = 'No'
for i in range(3):
  if check[i][0] == 1 and check[i][1] == 1 and check[i][2] == 1:
    ans = 'Yes'
    
for i in range(3):
  if check[0][i] == 1 and check[1][i] == 1 and check[2][i] == 1:
    ans = 'Yes'
    
if check[0][0] == 1 and check[1][1] == 1 and check[2][2] == 1:
  ans = 'Yes'
  
if check[0][2] == 1 and check[1][1] == 1 and check[2][0] == 1:
  ans = 'Yes'
  
print(ans)
  

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

check = [[0 for _ in range(3)] for _ in range(3)]

for i in range(N):
  for j in range(3):
    for k in range(3):
      if bingo[j][k] == number[i]:
        check[j][k] = 1
        
ans = 'No'
for i in range(3):
  if check[i][0] == 1 and check[i][1] == 1 and check[i][2] == 1:
    ans = 'Yes'
    
for i in range(3):
  if check[0][i] == 1 and check[1][i] == 1 and check[2][i] == 1:
    ans = 'Yes'
    
if check[0][0] == 1 and check[1][1] == 1 and check[2][2] == 1:
  ans = 'Yes'
  
if check[0][2] == 1 and check[1][1] == 1 and check[2][0] == 1:
  ans = 'Yes'
  
print(ans)
Buggy code:
import sys

ll = [[int(x) for x in input().split()] for y in range(3)]

n = int(input())

for i in range(n):
    b = int(input())
    for ii in range(3):
        if b in ll[ii]:
            ll[ii][ll[ii].index(b)] = 0

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

if ll[0][0] == ll[1][1] == ll[2][2] == 0 or ll[0][2] == ll[1][1] == ll[2][0] == 0:
    print("Yes")
    sys.exit()

print(ll)
print("No")


Fixed code:
import sys

ll = [[int(x) for x in input().split()] for y in range(3)]

n = int(input())

for i in range(n):
    b = int(input())
    for ii in range(3):
        if b in ll[ii]:
            ll[ii][ll[ii].index(b)] = 0

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

if ll[0][0] == ll[1][1] == ll[2][2] == 0 or ll[0][2] == ll[1][1] == ll[2][0] == 0:
    print("Yes")
    sys.exit()

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

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

b1 = [0] * 3
b2 = [0] * 3
b3 = [0] * 3

for i in b:
    for j in range(3):
        if i == a1[j]:
            b1[j] = 1
for i in b:
    for j in range(3):
        if i == a2[j]:
            b2[j] = 1
for i in b:
    for j in range(3):
        if i == a3[j]:
            b3[j] = 1

print(b1)
print(b2)
print(b3)


if b1[0] == b2[0] == b3[0] ==1 or b1[1] == b2[1] == b3[1] == 1 or b1[2] == b2[2] == b3[2]==1:
    print("Yes")
    exit()
elif b1[0] == b2[1] == b3[2] == 1 or b1[2] == b2[1] == b3[0] ==1:
    print("Yes")
    exit()
elif b1[0] == b1[1] == b1[2] == 1 or b2[0] == b2[1] == b2[2] == 1 or b3[0] == b3[1] == b3[2] == 1:
    print("Yes")
    exit()

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

b1 = [0] * 3
b2 = [0] * 3
b3 = [0] * 3

for i in b:
    for j in range(3):
        if i == a1[j]:
            b1[j] = 1
for i in b:
    for j in range(3):
        if i == a2[j]:
            b2[j] = 1
for i in b:
    for j in range(3):
        if i == a3[j]:
            b3[j] = 1

if b1[0] == b2[0] == b3[0] ==1 or b1[1] == b2[1] == b3[1] == 1 or b1[2] == b2[2] == b3[2]==1:
    print("Yes")
    exit()
elif b1[0] == b2[1] == b3[2] == 1 or b1[2] == b2[1] == b3[0] ==1:
    print("Yes")
    exit()
elif b1[0] == b1[1] == b1[2] == 1 or b2[0] == b2[1] == b2[2] == 1 or b3[0] == b3[1] == b3[2] == 1:
    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())

b1 = [0,0,0]
b2 = [0,0,0]
b3 = [0,0,0]

for i in range(n):
    b = int(input())
    for j in range(3):
        if a1[j] == b:
            b1[j] = 1
        if a2[j] == b:
            b2[j] = 1
        if a3[j] == b:
            b3[j] = 1

if b1[0] == 1 and b1[1] == 1 and b1[2] == 1:
    print("yes")
elif b2[0] == 1 and b2[1] == 1 and b2[2] == 1:
    print("yes")
elif b3[0] == 1 and b3[1] == 1 and b3[2] == 1:
    print("yes")
elif b1[0] == 1 and b2[0] == 1 and b3[0] == 1:
    print("yes")
elif b1[1] == 1 and b2[1] == 1 and b3[1] == 1:
    print("yes")
elif b1[2] == 1 and b2[2] == 1 and b3[2] == 1:
    print("yes")
elif b1[0] == 1 and b2[1] == 1 and b3[2] == 1:
    print("yes")
elif b1[2] == 1 and b2[1] == 1 and b3[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())

b1 = [0,0,0]
b2 = [0,0,0]
b3 = [0,0,0]

for i in range(n):
    b = int(input())
    for j in range(3):
        if a1[j] == b:
            b1[j] = 1
        if a2[j] == b:
            b2[j] = 1
        if a3[j] == b:
            b3[j] = 1

if b1[0] == 1 and b1[1] == 1 and b1[2] == 1:
    print("Yes")
elif b2[0] == 1 and b2[1] == 1 and b2[2] == 1:
    print("Yes")
elif b3[0] == 1 and b3[1] == 1 and b3[2] == 1:
    print("Yes")
elif b1[0] == 1 and b2[0] == 1 and b3[0] == 1:
    print("Yes")
elif b1[1] == 1 and b2[1] == 1 and b3[1] == 1:
    print("Yes")
elif b1[2] == 1 and b2[2] == 1 and b3[2] == 1:
    print("Yes")
elif b1[0] == 1 and b2[1] == 1 and b3[2] == 1:
    print("Yes")
elif b1[2] == 1 and b2[1] == 1 and b3[0] == 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 = list(int(input()) for i in range(N))

ans = 0
for a in A1:
  if a in B:
    ans += 1
if ans == 3:
  print('Yes')
else:
  ans = 0
  for a in A2:
    if a in B:
      ans += 1
  if ans==3:
    print('Yes')
  else:
    ans = 0
    for a in A3:
      if a in B:
        ans += 1
    if ans==3:
      print('Yes')  
    else:
      ans = 0
      for a in [A1[0], A2[0], A3[0]]:
        if a in B:
          ans += 1
      if ans==3:
        print('Yes') 
      else:
        ans = 0
        for a in [A1[1], A2[1], A3[1]]:
          if a in B:
            ans += 1
        if ans==3:
          print('Yes')
        else:
          ans = 0
          for a in [A1[2], A2[2], A3[2]]:
            if a in B:
              ans += 1
          if ans==3:
            print('Yes')
          else:
            ans = 0
          for a in [A1[0], A2[1], A3[2]]:
            if a in B:
              ans += 1
          if ans==3:
            print('Yes')
          else:
            ans = 0
            for a in [A1[2], A2[1], A3[0]]:
              if a in B:
                ans += 1
            if ans==3:
              print('Yes')

Fixed code:
A1 = list(map(int, input().split()))
A2 = list(map(int, input().split()))
A3 = list(map(int, input().split()))
N = int(input())

B = list(int(input()) for i in range(N))

ans = 0
for a in A1:
  if a in B:
    ans += 1
if ans == 3:
  print('Yes')
else:
  ans = 0
  for a in A2:
    if a in B:
      ans += 1
  if ans==3:
    print('Yes')
  else:
    ans = 0
    for a in A3:
      if a in B:
        ans += 1
    if ans==3:
      print('Yes')  
    else:
      ans = 0
      for a in [A1[0], A2[0], A3[0]]:
        if a in B:
          ans += 1
      if ans==3:
        print('Yes') 
      else:
        ans = 0
        for a in [A1[1], A2[1], A3[1]]:
          if a in B:
            ans += 1
        if ans==3:
          print('Yes')
        else:
          ans = 0
          for a in [A1[2], A2[2], A3[2]]:
            if a in B:
              ans += 1
          if ans==3:
            print('Yes')
          else:
            ans = 0
            for a in [A1[0], A2[1], A3[2]]:
              if a in B:
                ans += 1
            if ans==3:
              print('Yes')
            else:
              ans = 0
              for a in [A1[2], A2[1], A3[0]]:
                if a in B:
                  ans += 1
              if ans==3:
                print('Yes')
              else:
                print('No')
Buggy code:
def main():
    top = list(map(int, input().split()))
    middle = list(map(int, input().split()))
    bottom = list(map(int, input().split()))
    N = int(input())
    taken = []
    for i in range(N):
        taken.append(int(input()))
    
    bingo = []
    bingo.append(top)
    bingo.append(middle)
    bingo.append(bottom)
    temp = [top[0], middle[0], bottom[0]]
    bingo.append(temp)
    temp = [top[1], middle[1], bottom[1]]
    bingo.append(temp)
    temp = [top[2], middle[2], bottom[2]]
    bingo.append(temp)
    temp = [top[0], middle[1], bottom[2]]
    bingo.append(temp)
    temp = [top[2], middle[1], bottom[0]]
    bingo.append(0)
 
 
    cnt = 0
    flag = 0
    for i in range(len(bingo)):
        cnt = 0
        for j in range(len(bingo[i])):
            if bingo[i][j] in taken:
                cnt += 1
        if cnt == 3:
            flag += 1
    
    if flag > 0:
        print('Yes')
    else:
        print('No')
main()

Fixed code:
def main():
    top = list(map(int, input().split()))
    middle = list(map(int, input().split()))
    bottom = list(map(int, input().split()))
    N = int(input())
    taken = []
    for i in range(N):
        taken.append(int(input()))
    
    bingo = []
    bingo.append(top)
    bingo.append(middle)
    bingo.append(bottom)
    temp = [top[0], middle[0], bottom[0]]
    bingo.append(temp)
    temp = [top[1], middle[1], bottom[1]]
    bingo.append(temp)
    temp = [top[2], middle[2], bottom[2]]
    bingo.append(temp)
    temp = [top[0], middle[1], bottom[2]]
    bingo.append(temp)
    temp = [top[2], middle[1], bottom[0]]
    bingo.append(temp)
 
 
    cnt = 0
    flag = 0
    for i in range(len(bingo)):
        cnt = 0
        for j in range(len(bingo[i])):
            if bingo[i][j] in taken:
                cnt += 1
        if cnt == 3:
            flag += 1
    
    if flag > 0:
        print('Yes')
    else:
        print('No')
main()
Buggy code:
mat = [[0 for i in range(3)] for j in range(3)]
for i in range(3):
    mat[i] = list(map(int, input().split()))

n = int(input())
for _ in range(n):
    b = int(input())
    for x in range(3):
        for y in range(3):
            if mat[x][y] == b:
                mat[x][y] = 0

flg = False
for x in range(3):
    if (mat[x][0], mat[x][1], mat[x][2] == [0, 0, 0]):
        flg = True

for x in range(3):
    if (mat[0][x], mat[1][x], mat[2][x] == [0, 0, 0]):
        flg = True

if (mat[0][0], mat[1][1], mat[2][2] == [0, 0, 0]):
    flg = True

if (mat[0][2], mat[1][1], mat[2][0] == [0, 0, 0]):
    flg = True

print("Yes") if flg else print("No")

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

n = int(input())
for _ in range(n):
    b = int(input())
    for x in range(3):
        for y in range(3):
            if mat[x][y] == b:
                mat[x][y] = 101

flg = False
for x in range(3):
    if [mat[x][0], mat[x][1], mat[x][2]] == [101, 101, 101]:
        flg = True

for x in range(3):
    if [mat[0][x], mat[1][x], mat[2][x]] == [101, 101, 101]:
        flg = True

if [mat[0][0], mat[1][1], mat[2][2]] == [101, 101, 101]:
    flg = True

if [mat[0][2], mat[1][1], mat[2][0]] == [101, 101, 101]:
    flg = True

print("Yes") if flg else print("No")
Buggy code:
A0 = list(map(int, input().split(" ")))
A1 = list(map(int, input().split(" ")))
A2 = list(map(int, input().split(" ")))



A = [A0, A1, A2]

M = [
    [False, False, False],
    [False, False, False],
    [False, False, False],
]

N = int(input())
for _ in range(N):
    b = int(input())
    for i, row in enumerate(A):
        for j, col in enumerate(row):
            if col == b:
                M[i][j] = True

flag = False
for row in M:
    if all(row):
        flag = True

for i in range(3):
    col = []
    for j in range(3):
        col.append(M[j][i])

    if all(col):
        flag = True

dia0 = []
dia1 = []
for i in range(3):
    dia0.append(M[i][j])
    dia1.append(M[i][2 - i])

if all(dia0):
    flag = True

if all(dia1):
    flag = True

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




Fixed code:
A0 = list(map(int, input().split(" ")))
A1 = list(map(int, input().split(" ")))
A2 = list(map(int, input().split(" ")))

A = [A0, A1, A2]

M = [
    [False, False, False],
    [False, False, False],
    [False, False, False],
]

N = int(input())
for _ in range(N):
    b = int(input())
    for i, row in enumerate(A):
        for j, col in enumerate(row):
            if col == b:
                M[i][j] = True

flag = False
for row in M:
    if all(row):
        flag = True

for i in range(3):
    col = []
    for j in range(3):
        col.append(M[j][i])

    if all(col):
        flag = True

dia0 = []
dia1 = []
for i in range(3):
    dia0.append(M[i][i])
    dia1.append(M[i][2 - i])

if all(dia0):
    flag = True

if all(dia1):
    flag = True

if flag:
    print("Yes")
else:
    print("No")
Buggy code:
ls=[]
for i in range(3):
    ls1=list(map(int,input().split()))
    ls.append(list(ls1))
    ls1.clear()
print(ls)
N=int(input())
for i in range(N):
    b = int(input())
    for j in range(3):
        for l in range(3):
        if ls[l][j] == b:
            ls[l][j] = -1
for i in range(3):
    if ls[i][0] == ls[i][1] == ls[i][2] == -1:
        print("Yes")
        break
    elif ls[0][i] == ls[1][i] == ls[2][i] == -1:
        print("Yes")
        break
    elif ls[0][0] == ls[1][1] == ls[2][2] == -1:
        print("Yes")
        break
    elif ls[0][2] == ls[1][1] == ls[2][0] == -1:
        print("Yes")
        break
    print("No")


Fixed code:
ls=[]
for i in range(3):
    ls1=list(map(int,input().split()))
    ls.append(list(ls1))
    ls1.clear()
#print(ls)
N=int(input())
for i in range(N):
    b = int(input())
    for j in range(3):
        for l in range(3):
            if ls[l][j] == b:
                ls[l][j] = -1
flg = False
for i in range(3):
    if ls[i][0] == ls[i][1] == ls[i][2] == -1:
        print("Yes")
        flg = True
        break
    elif ls[0][i] == ls[1][i] == ls[2][i] == -1:
        print("Yes")
        flg = True
        break
    elif ls[0][0] == ls[1][1] == ls[2][2] == -1:
        print("Yes")
        flg = True
        break
    elif ls[0][2] == ls[1][1] == ls[2][0] == -1:
        print("Yes")
        flg = True
        break
if flg == False:
    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())

for i in range(n):
    b = int(input())
    for j in range(3):
        if A1[j] == b:
            A1[j] = 0
        if A2[j] == b:
            A2[j] = 0
        if A3[j] == b:
            A3[j] = 0

if A1[0]==A1[1]==A1[2]==0:
    print("Yes")
    exit
if A2[0]==A2[1]==A2[2]==0:
    print("Yes")
    exit
if A3[0]==A3[1]==A3[2]==0:
    print("Yes")
    exit

if A1[0]==A2[0]==A3[0]==0:
    print("Yes")
    exit
if A1[1]==A2[1]==A3[1]==0:
    print("Yes")
    exit
if A1[2]==A2[2]==A3[2]==0:
    print("Yes")
    exit
    
if A1[0]==A2[1]==A3[2]==0:
    print("Yes")
    exit
if A1[2]==A2[1]==A3[0]==0:
    print("Yes")
    exit
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())

for i in range(n):
    b = int(input())
    for j in range(3):
        if A1[j] == b:
            A1[j] = 0
        if A2[j] == b:
            A2[j] = 0
        if A3[j] == b:
            A3[j] = 0

if A1[0]==A1[1]==A1[2]==0:
    print("Yes")
    exit
elif A2[0]==A2[1]==A2[2]==0:
    print("Yes")
    exit
elif A3[0]==A3[1]==A3[2]==0:
    print("Yes")
    exit

elif A1[0]==A2[0]==A3[0]==0:
    print("Yes")
    exit
elif A1[1]==A2[1]==A3[1]==0:
    print("Yes")
    exit
elif A1[2]==A2[2]==A3[2]==0:
    print("Yes")
    exit
    
elif A1[0]==A2[1]==A3[2]==0:
    print("Yes")
    exit
elif A1[2]==A2[1]==A3[0]==0:
    print("Yes")
    exit
else:
    print("No")
Buggy code:
for i in range(3):
    line = input().rstrip().split(' ')
    array_1.append(line)

bool_array = []
for i in range(3):
    tmp = []
    for j in range(3):
        tmp.append(False)
    bool_array.append(tmp)
num = int(input().rstrip())
for i in range(num):
    input_line = input().rstrip()
    for j in range(3):
        for k in range(3):
            if array_1[j][k] == input_line:
                bool_array[j][k] = True

ans = "No"
for i in range(3):
    if bool_array[i][0] and bool_array[i][1] and bool_array[i][2]:
        ans = 'Yes'

    if bool_array[0][i] and bool_array[1][i] and bool_array[2][i]:
        ans = 'Yes'

if bool_array[0][0] and bool_array[1][1] and bool_array[2][2]:
    ans = 'Yes'

if bool_array[0][2] and bool_array[1][1] and bool_array[2][0]:
    ans = 'Yes'
print(ans)


Fixed code:
array_1 = []
for i in range(3):
    line = input().rstrip().split(' ')
    array_1.append(line)
    
# print(array_1)

bool_array = []
for i in range(3):
    tmp = []
    for j in range(3):
        tmp.append(False)
    bool_array.append(tmp)

# print(bool_array)

num = int(input().rstrip())
for i in range(num):
    input_line = input().rstrip()
    for j in range(3):
        for k in range(3):
            if array_1[j][k] == input_line:
                bool_array[j][k] = True

ans = "No"
for i in range(3):
    if bool_array[i][0] and bool_array[i][1] and bool_array[i][2]:
        ans = 'Yes'

for i in range(3):
    if bool_array[0][i] and bool_array[1][i] and bool_array[2][i]:
        ans = 'Yes'

if bool_array[0][0] and bool_array[1][1] and bool_array[2][2]:
    ans = 'Yes'

if bool_array[0][2] and bool_array[1][1] and bool_array[2][0]:
    ans = 'Yes'
    
    
print(ans)