qyliang/CodeNanoFix huggingface dataset:
Buggy code:
import sys

def calc_flag(b,a,flag):
    if b in a:
        # flag[a.index(b)] = 1
        l_index = [i for i, x in enumerate(a) if x == b]
        for l in l_index:
            flag[l]=1
    return flag

a1 = list(map(int,input().split()))
a2 = list(map(int,input().split()))
a3 = list(map(int,input().split()))
n = int(input())

flag1 = [0,0,0]
flag2 = [0,0,0]
flag3 = [0,0,0]

for i in range(n):
    b = int(input())
    flag1 = calc_flag(b,a1,flag1)
    flag2 = calc_flag(b,a2,flag2)
    flag3 = calc_flag(b,a3,flag3)

print(flag1,flag2,flag3)

for i in range(3): #tate
    if flag1[i]+flag2[i]+flag3[i]==3:
        print('Yes')
        sys.exit()

if flag1[0]+flag2[1]+flag3[2]==3 or flag1[2]+flag2[1]+flag3[0]==3: #naname
    print('Yes')
elif sum(flag1)==3 or sum(flag2)==3 or sum(flag3)==3: #yoko
    print('Yes')
else:
    print('No')







Fixed code:
import sys

def calc_flag(b,a,flag):
    if b in a:
        # flag[a.index(b)] = 1
        l_index = [i for i, x in enumerate(a) if x == b]
        for l in l_index:
            flag[l]=1
    return flag

a1 = list(map(int,input().split()))
a2 = list(map(int,input().split()))
a3 = list(map(int,input().split()))
n = int(input())

flag1 = [0,0,0]
flag2 = [0,0,0]
flag3 = [0,0,0]

for i in range(n):
    b = int(input())
    flag1 = calc_flag(b,a1,flag1)
    flag2 = calc_flag(b,a2,flag2)
    flag3 = calc_flag(b,a3,flag3)

# print(flag1,flag2,flag3)

for i in range(3): #tate
    if flag1[i]+flag2[i]+flag3[i]==3:
        print('Yes')
        sys.exit()

if flag1[0]+flag2[1]+flag3[2]==3 or flag1[2]+flag2[1]+flag3[0]==3: #naname
    print('Yes')
elif sum(flag1)==3 or sum(flag2)==3 or sum(flag3)==3: #yoko
    print('Yes')
else:
    print('No')
Buggy code:
import numpy as np

def run():
  A = [list(map(int, input().split())) for n in range(3)]
  A = np.array(A)
  N = int(input())
  for n in range(N):
    b = int(input())
    for i in range(3):
      for j in range(3):
        a = A[i][j]
        if a == b:
          A[i][j] = 0
  print(A)
  ans = 1
  left = 0
  right = 0
  for i in range(3):
    ans = min(ans, np.sum(A, axis=0)[i])
    ans = min(ans, np.sum(A, axis=1)[i])
    left += A[i][i]
    right += A[i][2-i]
  ans = min(ans, left, right)
  if ans == 0:
    print('Yes')
  else:
    print('No')
    

if __name__ == '__main__':
  run()


Fixed code:
import numpy as np

def run():
  A = [list(map(int, input().split())) for n in range(3)]
  A = np.array(A)
  N = int(input())
  for n in range(N):
    b = int(input())
    for i in range(3):
      for j in range(3):
        a = A[i][j]
        if a == b:
          A[i][j] = 0
  ans = 1
  left = 0
  right = 0
  for i in range(3):
    ans = min(ans, np.sum(A, axis=0)[i])
    ans = min(ans, np.sum(A, axis=1)[i])
    left += A[i][i]
    right += A[i][2-i]
  ans = min(ans, left, right)
  if ans == 0:
    print('Yes')
  else:
    print('No')
    

if __name__ == '__main__':
  run()
Buggy code:
A = [list(map(int, input().split())) for _ in range(3)]
N = int(input())
B =  [int(input()) for _ in range(N)]

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

for i in range(3):
  if A[i][0] == A[i][1] == A[i][2] == 0:
    print('Yes')
    exit()

  if A[0][i] == A[1][i] == A[2][i] == 0:
    print('Yes')
    exit()
    
if A[0][0] == A[1][1] == A[2][2] == 0:
    print('Yes')
    exit()
 

if A[0][2] == A[1][1] == A[2][0] == 0:
    print('Yes')
    exit()
    
  
print('No')


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

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

for i in range(3):
  if A[i][0] == A[i][1] == A[i][2] == 0:
    print('Yes')
    exit()

  if A[0][i] == A[1][i] == A[2][i] == 0:
    print('Yes')
    exit()
    
if A[0][0] == A[1][1] == A[2][2] == 0:
    print('Yes')
    exit()
 

if A[0][2] == A[1][1] == A[2][0] == 0:
    print('Yes')
    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)]

key = []
for i, v in enumerate(A):
    for k, j in enumerate(v):
        if (j in B):
            key.append([i, k])

ans = [[[0, 0], [1, 0], [2, 0]], [[0, 1], [1, 1], [2, 1]], [[0, 2], [1, 2], [2, 2]], [[0, 0], [1, 1], [2, 2]], [
    [0, 2], [1, 1], [2, 0]], [[0, 0], [0, 1], [0, 2]], [[1, 0], [1, 1], [1, 2]], [[2, 0], [2, 1], [2, 2]]]

for i in ans:
    for j in i:
        if (j in key.sort()):
            print('Yes')
            exit()

print('No')


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

key = []
for i, v in enumerate(A):
    for k, j in enumerate(v):
        if (j in B):
            key.append([i, k])

ans = [[[0, 0], [1, 0], [2, 0]], [[0, 1], [1, 1], [2, 1]], [[0, 2], [1, 2], [2, 2]], [[0, 0], [1, 1], [2, 2]], [
    [0, 2], [1, 1], [2, 0]], [[0, 0], [0, 1], [0, 2]], [[1, 0], [1, 1], [1, 2]], [[2, 0], [2, 1], [2, 2]]]

for i in ans:
    count = 0
    for j in i:
        if (j in key):
            count += 1
    if (count == 3):
        print('Yes')
        exit()

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

G=[['.']*3 for _ in range(3)]
for i in range(3):
    for j in range(3):
        if A[i][j] in B:
            G[i][j]='#'
print(G)

if any(all(G[i][j]=='#' for i in range(3)) for j in range(3)) or \
   any(all(G[i][j]=='#' for j in range(3)) for i in range(3)) or \
   all(G[i][2-i]=='#' for i in range(3)) or \
   all(G[i][i]=='#' for i in range(3)):
    print('Yes')
else:
    print('No')

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

G=[['.']*3 for _ in range(3)]
for i in range(3):
    for j in range(3):
        if A[i][j] in B:
            G[i][j]='#'
# print(G)

if any(all(G[i][j]=='#' for i in range(3)) for j in range(3)) or \
   any(all(G[i][j]=='#' for j in range(3)) for i in range(3)) or \
   all(G[i][2-i]=='#' for i in range(3)) or \
   all(G[i][i]=='#' for i in range(3)):
    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()))
A = [A1,A2,A3]
n = int(input())
B = [int(input()) for i in range(n)]
for i in range(n):
  for j in range(3):
    for k in range(3):
      if B[i] == A[j][k]:
        A[j][k] = "*"
ans = ["*","*","*"]
for i in range(3):
  if A[i] == ans or [A[0][i],A[1][i],A[2][i]] == ans:
    print("Yes")
    exit()
    
if [A[0][0],A[1][1],A[2][2]] == ans or [A[2][0],A[1][1],A[0][2]] == ans:
  print("Yes")
else:
  pass

print("No")

Fixed code:
A1 = list(map(int, input().split()))
A2 = list(map(int, input().split()))
A3 = list(map(int, input().split()))
A = [A1,A2,A3]
n = int(input())
B = [int(input()) for i in range(n)]
for i in range(n):
  for j in range(3):
    for k in range(3):
      if B[i] == A[j][k]:
        A[j][k] = "*"
ans = ["*","*","*"]
for i in range(3):
  if A[i] == ans or [A[0][i],A[1][i],A[2][i]] == ans:
    print("Yes")
    exit()
    
if [A[0][0],A[1][1],A[2][2]] == ans or [A[0][2],A[1][1],A[2][0]] == ans:
  print("Yes")
  exit()

print("No")
Buggy code:
a11,a12,a13=map(int,input().split())
a21,a22,a23=map(int,input().split())
a31,a32,a33=map(int,input().split())

n=int(input())

card=[a11,a12,a13,a21,a22,a23,a31,a32,a33]
def isBingo():
   if ( (card[0] == -1 and card[1] == -1 and card[2] == -1) \
      or (card[3] == -1 and card[4] == -1 and card[5] == -1) \
      or (card[6] == -1 and card[7] == -1 and card[8] == -1) \
      or (card[0] == -1 and card[3] == -1 and card[6] == -1) \
      or (card[1] == -1 and card[4] == -1 and card[7] == -1) \
      or (card[2] == -1 and card[5] == -1 and card[8] == -1) \
      or (card[0] == -1 and card[4] == -1 and card[8] == -1) \
      or (card[2] == -1 and card[4] == -1 and card[6] == -1) \
      ):
      return True
   else:
      return False
    
for i in range(n):
  if i in card:
    card[card.index(i)]=-1
if( isBingo()):
    print("Yes")
else:
    print("No")
    
       
       
       
       
       

Fixed code:
a11,a12,a13=map(int,input().split())
a21,a22,a23=map(int,input().split())
a31,a32,a33=map(int,input().split())

n=int(input())

card=[a11,a12,a13,a21,a22,a23,a31,a32,a33]
def isBingo():
   if ( (card[0] == -1 and card[1] == -1 and card[2] == -1) \
      or (card[3] == -1 and card[4] == -1 and card[5] == -1) \
      or (card[6] == -1 and card[7] == -1 and card[8] == -1) \
      or (card[0] == -1 and card[3] == -1 and card[6] == -1) \
      or (card[1] == -1 and card[4] == -1 and card[7] == -1) \
      or (card[2] == -1 and card[5] == -1 and card[8] == -1) \
      or (card[0] == -1 and card[4] == -1 and card[8] == -1) \
      or (card[2] == -1 and card[4] == -1 and card[6] == -1) \
      ):
      return True
   else:
      return False
    
for i in range(n):
  i= int(input())
  if i in card:
    card[card.index(i)]=-1
if( isBingo()):
    print("Yes")
else:
    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)]

cards = A[0] + A[1] + A[2]

for b in B:
    cards = [c if c != b else 0 for c in cards]

if (sum(A[0:3]) == 0):
    print('Yes')
elif (sum(A[3:6]) == 0):
    print('Yes')
elif (sum(A[7:9]) == 0):
    print('Yes')
elif ((A[0] + A[3] + A[6]) == 0):
    print('Yes')
elif ((A[1] + A[4] + A[7]) == 0):
    print('Yes')
elif ((A[2] + A[5] + A[8]) == 0):
    print('Yes')
elif ((A[0] + A[4] + A[8]) == 0):
    print('Yes')
elif ((A[2] + A[4] + A[6]) == 0):
    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)]

cards = A[0] + A[1] + A[2]

for b in B:
    cards = [c if c != b else 0 for c in cards]

if (sum(cards[0:3]) == 0):
    print('Yes')
elif (sum(cards[3:6]) == 0):
    print('Yes')
elif (sum(cards[6:9]) == 0):
    print('Yes')
elif ((cards[0] + cards[3] + cards[6]) == 0):
    print('Yes')
elif ((cards[1] + cards[4] + cards[7]) == 0):
    print('Yes')
elif ((cards[2] + cards[5] + cards[8]) == 0):
    print('Yes')
elif ((cards[0] + cards[4] + cards[8]) == 0):
    print('Yes')
elif ((cards[2] + cards[4] + cards[6]) == 0):
    print('Yes')
else:
    print('No')
Buggy code:
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 k in range(N):
    print(B[k][0])
    for i in range(3):
        for j in range(3):
            print(A[i][j])
            if B[k][0] == A[i][j]:
                A[i][j] = 0

if A[0][0] == A[0][1] == A[0][2] ==0:
    print("Yes")
elif A[1][0] == A[1][1] == A[1][2] ==0:
    print("Yes")
elif A[2][0] == A[2][1] == A[2][2] ==0:
    print("Yes")
elif A[0][0] == A[1][0] == A[2][0] ==0:
    print("Yes")
elif A[0][1] == A[1][1] == A[2][1] ==0:
    print("Yes")
elif A[0][2] == A[1][2] == A[2][2] ==0:
    print("Yes")
elif A[0][0] == A[1][1] == A[2][2] ==0:
    print("Yes")
elif A[2][2] == A[1][1] == A[2][0] ==0:
    print("Yes")
else:
    print("No")

Fixed code:
A = [list(map(int,input().split())) for i in range(3)]
N = int(input())
B = [list(map(int,input().split())) for i in range(N)]
for k in range(N):
    for i in range(3):
        for j in range(3):
            if B[k][0] == A[i][j]:
                A[i][j] = 0

if A[0][0] == A[0][1] == A[0][2] ==0:
    print("Yes")
elif A[1][0] == A[1][1] == A[1][2] ==0:
    print("Yes")
elif A[2][0] == A[2][1] == A[2][2] ==0:
    print("Yes")
elif A[0][0] == A[1][0] == A[2][0] ==0:
    print("Yes")
elif A[0][1] == A[1][1] == A[2][1] ==0:
    print("Yes")
elif A[0][2] == A[1][2] == A[2][2] ==0:
    print("Yes")
elif A[0][0] == A[1][1] == A[2][2] ==0:
    print("Yes")
elif A[0][2] == A[1][1] == A[2][0] ==0:
    print("Yes")
else:
    print("No")
Buggy code:
def resolve():
    a_list = list(map(int,input().split()))
    b_list = list(map(int,input().split()))
    c_list = list(map(int,input().split()))
    arr = np.array([a_list, b_list, c_list])

    n = int(input())
    for _ in range(n):
        num = int(input())
        arr = np.where(arr == num, 0, arr)

    if True in np.all(arr == 0, axis=0):
        print('Yes')
        return

    elif True in np.all(arr == 0, axis=1):
        print('Yes')
        return

    elif arr[0, 0] == 0 and arr[1, 1] == 0 and arr[2, 2] == 0:
        print('Yes')
        return

    elif arr[2, 0] == 0 and arr[1, 1] == 0 and arr[0, 2] == 0:
        print('Yes')
        return

    else:
        print('No')
        return
      
resolve()

Fixed code:
import numpy as np


def resolve():
    a_list = list(map(int,input().split()))
    b_list = list(map(int,input().split()))
    c_list = list(map(int,input().split()))
    arr = np.array([a_list, b_list, c_list])

    n = int(input())
    for _ in range(n):
        num = int(input())
        arr = np.where(arr == num, 0, arr)

    if True in np.all(arr == 0, axis=0):
        print('Yes')
        return

    elif True in np.all(arr == 0, axis=1):
        print('Yes')
        return

    elif arr[0, 0] == 0 and arr[1, 1] == 0 and arr[2, 2] == 0:
        print('Yes')
        return

    elif arr[2, 0] == 0 and arr[1, 1] == 0 and arr[0, 2] == 0:
        print('Yes')
        return

    else:
        print('No')
        return
      
resolve()
Buggy code:
l1 = list(map(int, input().split()))
l2 = list(map(int, input().split()))
l3 = list(map(int, input().split()))
n=int(input())
b = [int(input()) for i in range(n)]
f=False
for i in range(3):
    for j in range(n):
        if l1[i]==b[j]:
            l1[i]=0
        elif l2[i]==b[j]:
            l2[i]=0
        elif l3[i]==b[j]:
            l3[i]=0
for i in range(3):
    if l1[i]==l2[i] and l2[i]==l3[i] and l1[i]==l3[i]:
        f=True
if l1[0]==l1[1] and l1[1]==l[2] and l1[0]==l1[2]:
    f=True
elif l2[0]==l2[1] and l2[1]==l2[2] and l2[0]==l2[2]:
    f=True
elif l3[0]==l3[1] and l3[1]==l3[2] and l3[0]==l3[2]:
    f=True
elif l1[0]==0 and l2[1]==0 and l3[2]==0:
    f=True
elif l3[0]==0 and l1[2]==0 and l2[1]==0:
    f=True
    
if f==True:
    print('Yes')
else:
    print('No')

Fixed code:
l1 = list(map(int, input().split()))
l2 = list(map(int, input().split()))
l3 = list(map(int, input().split()))
n=int(input())
b = [int(input()) for i in range(n)]
f=False
for i in range(3):
    for j in range(n):
        if l1[i]==b[j]:
            l1[i]=0
        elif l2[i]==b[j]:
            l2[i]=0
        elif l3[i]==b[j]:
            l3[i]=0
for i in range(3):
    if l1[i]==l2[i] and l2[i]==l3[i] and l1[i]==l3[i]:
        f=True
if l1[0]==l1[1] and l1[1]==l1[2] and l1[0]==l1[2]:
    f=True
elif l2[0]==l2[1] and l2[1]==l2[2] and l2[0]==l2[2]:
    f=True
elif l3[0]==l3[1] and l3[1]==l3[2] and l3[0]==l3[2]:
    f=True
elif l1[0]==0 and l2[1]==0 and l3[2]==0:
    f=True
elif l3[0]==0 and l1[2]==0 and l2[1]==0:
    f=True
    
if f==True:
    print('Yes')
else:
    print('No')
Buggy code:
a_1 = list(map(int,input().split()))
a_2 = list(map(int,input().split()))
a_3 = list(map(int,input().split()))
a = [a_1,a_2,a_3]
n = int(input()):
for i in range(n):
  h = int(input())
  for j in range(3):
    for k in range(3):
      if(a[j][k]==h):
        a[j][k]=0
ans = "No"
for i in range(3):
  if(a[i][0]==0)and(a[i][0]==a[i][1])and(a[i][1]==a[i][2]):
    ans = "Yes"
for i in range(3):
  if(a[0][i]==0)and(a[0][i]==a[1][i])and(a[1][i]==a[2][i]):
    ans= "Yes"
if((a[0][0]==0)and(a[1][1]==a[2][2])and(a[0][0]==a[1][1]))or((a[0][2]==0)and(a[1][1]==a[2][0])and(a[0][2]==a[1][1])):
  ans = "Yes"
  
print(ans)
    
    

Fixed code:
a_1 = list(map(int,input().split()))
a_2 = list(map(int,input().split()))
a_3 = list(map(int,input().split()))
a = [a_1,a_2,a_3]
n = int(input())
for i in range(n):
  h = int(input())
  for j in range(3):
    for k in range(3):
      if(a[j][k]==h):
        a[j][k]=0
ans = "No"
for i in range(3):
  if(a[i][0]==0)and(a[i][0]==a[i][1])and(a[i][1]==a[i][2]):
    ans = "Yes"
for i in range(3):
  if(a[0][i]==0)and(a[0][i]==a[1][i])and(a[1][i]==a[2][i]):
    ans= "Yes"
if((a[0][0]==0)and(a[1][1]==a[2][2])and(a[0][0]==a[1][1]))or((a[0][2]==0)and(a[1][1]==a[2][0])and(a[0][2]==a[1][1])):
  ans = "Yes"
  
print(ans)
Buggy code:
A11, A12, A13 = map(int, input().split())
A21, A22, A23 = map(int, input().split())
A31, A32, A33 = map(int, input().split())
N = int(input())
B = {int(input()) for _ in range(N)}

h1 = {A11, A12, A13}
h2 = {A21, A22, A23}
h3 = {A31, A32, A33}
v1 = {A11, A21, A31}
v2 = {A12, A22, A32}
v3 = {A13, A23, A33}
c1 = {A11, A22, A33}
c2 = {A13, A22, A31}

if len(h1 & B)==3 or len(h2 & B)==3 or len(h3 & B)==3 or len(v1 & B)==3 or len(v2 & B)==3 or len(v3 & B)==3 or (c1 & B)==3 or len(c2 & B)==3:
    print("Yes")
else:
    print("No")



Fixed code:
A11, A12, A13 = map(int, input().split())
A21, A22, A23 = map(int, input().split())
A31, A32, A33 = map(int, input().split())
N = int(input())
B = {int(input()) for _ in range(N)}

h1 = {A11, A12, A13}
h2 = {A21, A22, A23}
h3 = {A31, A32, A33}
v1 = {A11, A21, A31}
v2 = {A12, A22, A32}
v3 = {A13, A23, A33}
c1 = {A11, A22, A33}
c2 = {A13, A22, A31}

if len(h1 & B)==3 or len(h2 & B)==3 or len(h3 & B)==3 or len(v1 & B)==3 or len(v2 & B)==3 or len(v3 & B)==3 or len(c1 & B)==3 or len(c2 & B)==3:
    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)]
con1 = A1[0] and A1[1] and A1[2]
con2 = A2[0] and A2[1] and A2[2]
con3 = A3[0] and A3[1] and A3[2]
con4 = A1[0] and A2[0] and A3[0]
con5 = A1[1] and A2[1] and A3[1]
con6 = A1[2] and A2[2] and A3[2]
con7 = A1[0] and A2[1] and A3[2]
con8 = A1[2] and A2[1] and A3[0]
if (con1 or con2 or con3 or con4 or con5 or con6 or con7 or con8) in B:
    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 _ in range(N)]

con1 = A1[0] in B and A1[1] in B and A1[2] in B
con2 = A2[0] in B and A2[1] in B and A2[2] in B
con3 = A3[0] in B and A3[1] in B and A3[2] in B
con4 = A1[0] in B and A2[0] in B and A3[0] in B
con5 = A1[1] in B and A2[1] in B and A3[1] in B
con6 = A1[2] in B and A2[2] in B and A3[2] in B
con7 = A1[0] in B and A2[1] in B and A3[2] in B
con8 = A1[2] in B and A2[1] in B and A3[0] in B

if (con1 or con2 or con3 or con4 or con5 or con6 or con7 or con8):
    print("Yes")
else:
    print("No")
Buggy code:
l=[]
for i in range(3):
    l.append(list(map(int, input().split())))
n = int(input())
for i in range(n):
    m = int(input())

    for j in range(3):
        for k in range(3):
            if l[j][k] == m:
                l[j][k] = -1
o=0
p=0
for j in range(3):
    for k in range(3):
        o+=l[j][k]
        p+=l[k][j]
    if o==-3 or p==-3:
        print('Yes')
        exit()
    o=0
    p=0
if l[0][0]+l[1][1]+l[2][2]==-3 or l[0][2]+l[1][1]+l[2][0]==-3:
    print('Yes2')
else:
    print('No')

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

    for j in range(3):
        for k in range(3):
            if l[j][k] == m:
                l[j][k] = -1
o=0
p=0
for j in range(3):
    for k in range(3):
        o+=l[j][k]
        p+=l[k][j]
    if o==-3 or p==-3:
        print('Yes')
        exit()
    o=0
    p=0
if l[0][0]+l[1][1]+l[2][2]==-3 or l[0][2]+l[1][1]+l[2][0]==-3:
    print('Yes')
else:
    print('No')
Buggy code:
a=[list(map(int,input().split())) for _ in range(3)]
f=[[0]*3 for _ in range(3)]
for _ in range(int(input())):
  x=int(input())
  for i in range(3):
    for j in range(3):
      if x==a[i][j]:
        f[i][j]=1
ans=0
if all(f[i] for i in range(3)):
  ans=1
for i in range(3):
  if all(f[i][j] for j in range(3)):
    ans=1
if f[0][0]==f[1][1]==f[2][2]==1 or f[0][2]==f[1][1]==f[2][0]==1:
  ans=1
print("Yes" if ans else "No")

Fixed code:
a=[list(map(int,input().split())) for _ in range(3)]
f=[[0]*3 for _ in range(3)]
for _ in range(int(input())):
  x=int(input())
  for i in range(3):
    for j in range(3):
      if x==a[i][j]:
        f[i][j]=1
ans=0
for i in range(3):
  if all(f[i][j] for j in range(3)) or all(f[j][i] for j in range(3)):
    ans=1
if f[0][0]==f[1][1]==f[2][2]==1 or f[0][2]==f[1][1]==f[2][0]==1:
  ans=1
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)]

for i in range(3):
    for j in range(3):
        if A[i][j] in B:
            A[i][j] = -1

for i in range(3):
    ans1, ans2 = 0, 0
    for j in range(3):
        if A[i][j] == -1:
            ans1 += 1
        if A[j][i] == -1:
            ans2 += 1
    if ans1 == 3 or ans2 == 3:
        print("Yes")
        exit()

if (A[0][0] != -1 or A[1][1] != -1 or A[2][2] != -1) or \
        (A[0][2] != -1 or A[1][1] != -1 or A[2][0] != -1):
    print("No")
else:
    print("Yes")

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(3):
    for j in range(3):
        if A[i][j] in B:
            A[i][j] = -1

for i in range(3):
    ans1, ans2 = 0, 0
    for j in range(3):
        if A[i][j] == -1:
            ans1 += 1
        if A[j][i] == -1:
            ans2 += 1
    if ans1 == 3 or ans2 == 3:
        print("Yes")
        exit()

if (A[0][0] == -1 and A[1][1] == -1 and A[2][2] == -1) or \
        (A[0][2] == -1 and A[1][1] == -1 and A[2][0] == -1):
    print("Yes")
else:
    print("No")
Buggy code:
row1 = list(map(int,input().split()))
row2 = list(map(int,input().split()))
row3 = list(map(int,input().split()))

n = int(input())
nums = []
ans = "No"

for i in range(0, n):
  nums.append(int(input()))
  
for i in range(0,3):
  if row1[i] in nums: row1[i] == "O"
  if row2[i] in nums: row2[i] == "O"
  if row3[i] in nums: row3[i] == "O"
    
#Columns
for i in range(0,3):
  if row1[i] == row2[i] == row3[i]: ans = "Yes"
    
#Rows
if row1 == ["O","O","O"] or row2 == ["O","O","O"] or row3 == ["O","O","O"]: ans = "Yes"
  
#Diagonals
if row1[0] == row2[1] == row3[2] or row1[2] == row2[1] == row3[0]: ans = "Yes"
  
print(ans)

Fixed code:
row1 = list(map(int,input().split()))
row2 = list(map(int,input().split()))
row3 = list(map(int,input().split()))

n = int(input())
nums = []
ans = "No"


for i in range(0, n):
  nums.append(int(input()))

for i in range(0,3):
  if row1[i] in nums: row1[i] = "O"
  if row2[i] in nums: row2[i] = "O"
  if row3[i] in nums: row3[i] = "O"

#Columns
for i in range(0,3):
  if row1[i] == row2[i] == row3[i]: ans = "Yes"
    
#Rows
if row1 == ["O","O","O"] or row2 == ["O","O","O"] or row3 == ["O","O","O"]: ans = "Yes"
  
#Diagonals
if row1[0] == row2[1] == row3[2] or row1[2] == row2[1] == row3[0]: ans = "Yes"
  
print(ans)
Buggy code:
n11, n12, n13 = map(int,input().split())
n21, n22, n23 = map(int,input().split())
n31, n32, n33 = map(int,input().split())
lines = [[n11,n12,n13],
         [n21,n22,n23],
         [n31,n32,n33],
         [n11,n21,n31],
         [n12,n22,n32],
         [n13,n23,n33],
         [n11,n22,n33],
         [n13,n22,n31]]
nums = {}
r = input()
for i in range(int(r)):
  nums[input()] = 0
flag = False
for l in lines:
  if l[0] in nums:
    if l[1] in nums:
      if l[2] in nums:
        flag = True
if flag:
  print("No")
else:
  print("Yes")

Fixed code:
n11, n12, n13 = map(int,input().split())
n21, n22, n23 = map(int,input().split())
n31, n32, n33 = map(int,input().split())
lines = [[n11,n12,n13],
         [n21,n22,n23],
         [n31,n32,n33],
         [n11,n21,n31],
         [n12,n22,n32],
         [n13,n23,n33],
         [n11,n22,n33],
         [n13,n22,n31]]
nums = {}
r = input()
for i in range(int(r)):
  nums[int(input())] = 0
flag = False
for l in lines:
  if l[0] in nums:
    if l[1] in nums:
      if l[2] in nums:
        flag = True
if flag:
  print("Yes")
else:
  print("No")