qyliang/CodeNanoFix huggingface dataset:
Buggy code:
import bisect,collections,copy,heapq,itertools,math,numpy,string
import sys
sys.setrecursionlimit(10**7)
 
def _S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
 
def main():
    A = [LI() for _ in range(3)]
    N = I()
    B = [I() for _ in range(N)]
    # print(B) 
    
    for i in range(3):
        for j in range(3):
            for k in range(N):
                if A[i][j]== B[k]:
                    A[i][j] = 0
                    break

    ans = 'No'
    for i in range(3):
            if (A[i][0]==0 and A[i][1]==0 and A[i][2]==0) or (A[0][i]==0 and A[1][i]==0 and A[2][i]==0):
              ans = 'Yes'
              break  
    if (A[0][2]==0 and A[1][1]==0 and A[2][0]==0) or A[0][0]==0 and A[1][1]==0 and A[2][2]:
        ans = 'Yes'
    print(ans)
main()

Fixed code:
import bisect,collections,copy,heapq,itertools,math,numpy,string
import sys
sys.setrecursionlimit(10**7)
 
def _S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
 
def main():
    A = [LI() for _ in range(3)]
    N = I()
    B = [I() for _ in range(N)]
    # print(B) 
    
    for i in range(3):
        for j in range(3):
            for k in range(N):
                if A[i][j]== B[k]:
                    A[i][j] = 0
                    break
    
    ans = 'No'
    for i in range(3):
            if (A[i][0]==0 and A[i][1]==0 and A[i][2]==0) or (A[0][i]==0 and A[1][i]==0 and A[2][i]==0):
              ans = 'Yes'
              break  
    if (A[0][2]==0 and A[1][1]==0 and A[2][0]==0) or (A[0][0]==0 and A[1][1]==0 and A[2][2]==0):
        ans = 'Yes'
    print(ans)
main()
Buggy code:
a = [[0]*3]*3
for i in range(3):
  a[i] = list(map(int,input().split()))
  
  
def isInList(b,a):
  for i in range(len(a)):
    for j in range(len(a[i])):
      if a[i][j] == b:
        return i,j
      
  return 0,0
  
N = int(input())
for i in range(N):
  b = int(input())
  I,J = isInList(b,a)
  if I != 0:
    a[I][J] = -1
    
def judge(a):
  for i in range(3):
    if a[i][0] == -1 and a[i][1] == -1 and a[i][2] == -1:
      return True
  for i in range(3):
    if a[0][i] == -1 and a[1][i] == -1 and a[2][i] == -1:
      return True
  tmp = [a[i][i] for i in range(3)]
  if tmp == [-1,-1,-1]:
    return True
  tmp = [a[i][2-i] for i in range(3)]
  if tmp == [-1,-1,-1]:
    return True
  return False


ans = "Yes" if judge(a) else "No"
print(ans)
    

Fixed code:
a = [[0]*3]*3
for i in range(3):
  a[i] = list(map(int,input().split()))
  
def isInList(b,a):
  for i in range(len(a)):
    for j in range(len(a[i])):
      if a[i][j] == b:
        return i,j
      
  return -1,-1
  
N = int(input())
for i in range(N):
  b = int(input())
  I,J = isInList(b,a)
  if I != -1:
    a[I][J] = -1
    

def judge(a):
  for i in range(3):
    if a[i][0] == -1 and a[i][1] == -1 and a[i][2] == -1:
      return True
  for i in range(3):
    if a[0][i] == -1 and a[1][i] == -1 and a[2][i] == -1:
      return True
  tmp = [a[i][i] for i in range(3)]
  if tmp == [-1,-1,-1]:
    return True
  tmp = [a[i][2-i] for i in range(3)]
  if tmp == [-1,-1,-1]:
    return True
  return False


ans = "Yes" if judge(a) else "No"
print(ans)
Buggy code:
A = [0]*3
for i in range(3):
    A[i] = list(map(int,input().split()))
N = int(input())
B = []
for _ in range(N):
    B.append(int(input())
             
for k in range(3):
    for j in range(3):
        if A[k][j] in B:
             A[k][j] = 0
answer = 'No'
for i in range(3):
    if sum(A[i])==0:
        answer = 'Yes'
        break
    count = 0
    for j in range(3):
        count += A[j][i]
print(answer)

Fixed code:
A = [0]*3
for i in range(3):
    A[i] = list(map(int,input().split()))
N = int(input())
B = []
for _ in range(N):
    B.append(int(input()))
             
for k in range(3):
    for j in range(3):
        if A[k][j] in B:
             A[k][j] = 0
answer = 'No'
for i in range(3):
    if sum(A[i])==0:
        answer = 'Yes'
        break
    count = 0
    for j in range(3):
        count += A[j][i]
    if count == 0:
        answer = 'Yes'
if A[0][0]+A[1][1]+A[2][2]==0:
    answer = 'Yes'
if A[0][2]+A[1][1]+A[2][0]==0:
    answer = 'Yes'
print(answer)
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='No'

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

for i in range(3):
    if sum(A[i])==-3:
        ans='Yes'
    if A[0][i]+A[1][i]+A[2][i]==-3:
        ans='Yes'

if A[0][0]+A[1][1]+A[2][2]==-3:
    ans='Yes'

if A[0][2]+A[1][1]+A[2][0]==-3:
    ans='Yes'

print(ans)

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='No'

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):
    if sum(A[i])==-3:
        ans='Yes'
    if A[0][i]+A[1][i]+A[2][i]==-3:
        ans='Yes'

if A[0][0]+A[1][1]+A[2][2]==-3:
    ans='Yes'

if A[0][2]+A[1][1]+A[2][0]==-3:
    ans='Yes'

print(ans)
Buggy code:
array= []
for i in range(3):
    array.append(list(map(int,input().split())))
n= int(input())
number=[]
answer = "No"
for i in range(n):
    number.append(input())

for i in range (3):
    for j in range(3):
        for k in range(n):
            print(array[i][j])
            print(number[k])
            if int(array[i][j]) == int(number[k]):
                array[i][j] = 8101919

for i in range (3):
    if array[i][0] & array[i][1] & array[i][2] == 8101919:        
        answer = "Yes"

for i in range(3):
    if array[0][i] & array[1][i] & array[2][i] == 8101919:
        answer = "Yes"

if array[0][0] & array[1][1] & array[2][2] == 8101919:
    answer = "Yes"
           
if array[2][0] & array[1][1] & array [0][2] == 8101919:
    answer = "Yes"

print(answer)

Fixed code:
array= []
for i in range(3):
    array.append(list(map(int,input().split())))
n= int(input())
number=[]
answer = "No"
for i in range(n):
    number.append(input())

for i in range (3):
    for j in range(3):
        for k in range(n):
            if int(array[i][j]) == int(number[k]):
                array[i][j] = 8101919

for i in range (3):
    if array[i][0] & array[i][1] & array[i][2] == 8101919:        
        answer = "Yes"

for i in range(3):
    if array[0][i] & array[1][i] & array[2][i] == 8101919:
        answer = "Yes"

if array[0][0] & array[1][1] & array[2][2] == 8101919:
    answer = "Yes"
           
if array[2][0] & array[1][1] & array [0][2] == 8101919:
    answer = "Yes"

print(answer)
Buggy code:
import numpy as np

A1=np.array(list(map(int,input().split())))
A2=np.array(list(map(int,input().split())))
A3=np.array(list(map(int,input().split())))
A=np.concatenate([A1,A2,A3]).reshape(3,3)

N=int(input())

for i in range(N):
    b=int(input())
    A[np.where(A==b)] = 0

if np.all(A[0,:]==0) or np.all(A[1,:]==0) or np.all(A[2,:]==0) or np.all(A[:,0]==0) or np.all(A[:,1]==0) 
\or np.all(A[:,2]==0) or A[0,0]**2+A[1,1]**2+A[2,2]**2==0:
    print('Yes')
else:
    print('No')

Fixed code:
import numpy as np

A1=np.array(list(map(int,input().split())))
A2=np.array(list(map(int,input().split())))
A3=np.array(list(map(int,input().split())))
A=np.concatenate([A1,A2,A3]).reshape(3,3)

N=int(input())

for i in range(N):
    b=int(input())
    A[np.where(A==b)] = 0

if np.all(A[0,:]==0) or np.all(A[1,:]==0) or np.all(A[2,:]==0) or np.all(A[:,0]==0) or np.all(A[:,1]==0) \
    or np.all(A[:,2]==0) or A[0,0]**2+A[1,1]**2+A[2,2]**2==0 or A[0,2]**2+A[1,1]**2+A[2,0]**2==0:
    print('Yes')
else:
    print('No')
Buggy code:
a,b,c  = map(int, input().split())
d,e,f  = map(int, input().split())
g,h,i  = map(int, input().split())
n=int(input())
A = [input() for _ in range(n)]
if (a and b and c) in A:
    print("Yes")
elif (d and e and f) in A:
    print("Yes")
elif (g and h and i) in A:
    print("Yes")
elif (a and d and g) in A:
    print("Yes")
elif (b and e and h) in A:
    print("Yes")
elif (c and f and i) in A:
    print("Yes")
elif (a and e and i) in A:
    print("Yes")
elif (c and e and g) in A:
    print("Yes")
else:
    print("No")

Fixed code:
a,b,c  = map(int, input().split())
d,e,f  = map(int, input().split())
g,h,i  = map(int, input().split())
n=int(input())
A = []
for j in range(n):
    A.append(int(input()))
if (a in A) and (b in A) and (c in A):
    print("Yes")
elif d in A and e in A and f in A:
    print("Yes")
elif g in A and h in A and i in A:
    print("Yes")
elif a in A and d in A and g in A:
    print("Yes")
elif b in A and e in A and h in A:
    print("Yes")
elif c in A and f in A and i in A:
    print("Yes")
elif a in A and e in A and i in A:
    print("Yes")
elif c in A and e in A and g in A:
    print("Yes")
else:
    print("No")
Buggy code:
card = [input().split() for i in range(3)]
n = int(input())
for i in range(n):
    num = int(input())
    for i in range(3):
        for j in range(3):
            if card[i][j] == num:
                card[i][j] = 0
for i in range(3):
    if  (card[0][i] == 0 and card[1][i] == 0 and card[2][i]) or\
        (card[i][0] == 0 and card[i][1] == 0 and card[i][2]):
        print("Yes")
        exit()
if  (card[0][0] == 0 and card[1][1] == 0 and card[2][2]) or\
    (card[0][2] == 0 and card[1][1] == 0 and card[2][0]):
    print("Yes")
    exit()
print("No")

Fixed code:
card = [list(map(int,input().split())) for i in range(3)]
n = int(input())
for i in range(n):
    num = int(input())
    for i in range(3):
        for j in range(3):
            if card[i][j] == num:
                card[i][j] = 0
for i in range(3):
    if  (card[0][i] == 0 and card[1][i] == 0 and card[2][i] == 0) or\
        (card[i][0] == 0 and card[i][1] == 0 and card[i][2] == 0):
        print("Yes")
        exit()
if  (card[0][0] == 0 and card[1][1] == 0 and card[2][2] == 0) or\
    (card[0][2] == 0 and card[1][1] == 0 and card[2][0] == 0):
    print("Yes")
    exit()
print("No")
Buggy code:
A = []
for i in range(3):
  a = input().split()
  a = [int(num) for num in a]
  A.append(a)

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

for i in range(3):
  for j in range(3):
    if b.count(A[i][j]) != 0:
      A[i][j] = 0
    else:
      continue

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

Fixed code:
A = []
for i in range(3):
  a = input().split()
  a = [int(num) for num in a]
  A.append(a)

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

for i in range(3):
  for j in range(3):
    if b.count(A[i][j]) != 0:
      A[i][j] = 0
    else:
      continue

def Agetraw(j):
    Ans = [int(A[i][j]) for i in range(3)]
    return(Ans)

if (sum(A[0])==0 or sum(A[1])==0 or sum(A[2])==0 
    or sum(Agetraw(0))==0 or sum(Agetraw(1))==0 or sum(Agetraw(2))==0 
    or A[0][0]+A[1][1]+A[2][2]==0 or A[0][2]+A[1][1]+A[2][0]==0):
  print("Yes")
else:
  print("No")
Buggy code:
def main():
    A = [[int(a) for a in input().split()] for i in range(3)]
    N = int(input())
    b = [int(input()) for i in range(N)]
    print(A, N, b)
    for k in b:
        for i in range(3):
            for j in range(3):
                if A[i][j] == k:
                    A[i][j] = "x"
    bingo = False
    if A[0][0] == A[0][1] == A[0][2] == "x" or \
       A[1][0] == A[1][1] == A[1][2] == "x" or \
       A[2][0] == A[2][1] == A[2][2] == "x" or \
       A[0][0] == A[1][0] == A[2][0] == "x" or \
       A[0][1] == A[1][1] == A[2][1] == "x" or \
       A[0][2] == A[1][2] == A[2][2] == "x" or \
       A[0][0] == A[1][1] == A[2][2] == "x" or \
       A[0][2] == A[1][1] == A[2][0] == "x":
       bingo = True

    if bingo:
        print("Yes")
    else:
        print("No")
main()

Fixed code:
def main():
    A = [[int(a) for a in input().split()] for i in range(3)]
    N = int(input())
    b = [int(input()) for i in range(N)]
    for k in b:
        for i in range(3):
            for j in range(3):
                if A[i][j] == k:
                    A[i][j] = "x"
    bingo = False
    if A[0][0] == A[0][1] == A[0][2] == "x" or \
       A[1][0] == A[1][1] == A[1][2] == "x" or \
       A[2][0] == A[2][1] == A[2][2] == "x" or \
       A[0][0] == A[1][0] == A[2][0] == "x" or \
       A[0][1] == A[1][1] == A[2][1] == "x" or \
       A[0][2] == A[1][2] == A[2][2] == "x" or \
       A[0][0] == A[1][1] == A[2][2] == "x" or \
       A[0][2] == A[1][1] == A[2][0] == "x":
       bingo = True
       
    if bingo:
        print("Yes")
    else:
        print("No")
main()
Buggy code:
#157 b 
a=[]
call_num=[]
for i in range(3):
    x,y,z=map(int,input().split())
    a.append(x)
    a.append(y)
    a.append(z)
n=int(input())
for i in range(n):
    x=int(input())
    if x in a:
        call_num.append(a.index(x))
bingo
ans=[[0,1,2],[3,4,5],[6,7,8],[0,3,6],[1,4,7],[2,5,8],[0,4,8],[2,4,6]]
for x in ans:
    flag=True
    for y in x:
        if y not in call_num:
            flag=False
    if flag:
        print("Yes")
        bing=True
        break
if bing!=True:        
    print("No")


Fixed code:
#157 b
a=[]
call_num=[]
for i in range(3):
    x,y,z=map(int,input().split())
    a.append(x)
    a.append(y)
    a.append(z)
n=int(input())
for i in range(n):
    x=int(input())
    if x in a:
        call_num.append(a.index(x))
bingo=False
ans=[[0,1,2],[3,4,5],[6,7,8],[0,3,6],[1,4,7],[2,5,8],[0,4,8],[2,4,6]]
for x in ans:
    flag=True
    for y in x:
        if y not in call_num:
            flag=False
    if flag:
        print("Yes")
        bingo=True
        break
if bingo!=True:
    print("No")
Buggy code:
#author: dokueki



inp = []
for i in range(3):
    a = list(map(int, input().split()))
    inp.append(a)
res = []
for _ in range(int(input())):
    res.append(int(input()))
for i in range(3):
    for j in range(3):
        for k in res:
            if inp[i][j] == k:
                inp[i][j] = -1
r1, r2, r3, c1, c2, c3, d1, d2 = 0, 0, 0, 0, 0, 0, 0, 0
for i in range(3):
    if inp[i][0] == -1:
        r1 += 1
    if inp[i][1] == -1:
        r2 += 1
    if inp[i][2] == -1:
        r3 += 1
    if inp[0][i] == -1:
        c1 += 1
    if inp[1][i] == -1:
        c2 += 1
    if inp[2][i] == -1:
        c3 += 1
    if inp[i][i] == -1:
        d1 += 1
if inp[0][2] == inp[1][1] == inp[2][0] == -1:
    d2 += 3
if r1 == 3 or r2 == 3 or r3 == 3 or c1 == 3 or c2 == 3 or c3 == 3 or d1 == 3 or d2 == 3:
    print("YES")
else:
    print("NO")


Fixed code:
#author: dokueki




inp = []
for i in range(3):
    a = list(map(int, input().split()))
    inp.append(a)
res = []
for _ in range(int(input())):
    res.append(int(input()))
for i in range(3):
    for j in range(3):
        for k in res:
            if inp[i][j] == k:
                inp[i][j] = -1
r1, r2, r3, c1, c2, c3, d1, d2 = 0, 0, 0, 0, 0, 0, 0, 0
for i in range(3):
    if inp[i][0] == -1:
        r1 += 1
    if inp[i][1] == -1:
        r2 += 1
    if inp[i][2] == -1:
        r3 += 1
    if inp[0][i] == -1:
        c1 += 1
    if inp[1][i] == -1:
        c2 += 1
    if inp[2][i] == -1:
        c3 += 1
    if inp[i][i] == -1:
        d1 += 1
if inp[0][2] == inp[1][1] == inp[2][0] == -1:
    d2 += 3
if r1 == 3 or r2 == 3 or r3 == 3 or c1 == 3 or c2 == 3 or c3 == 3 or d1 == 3 or d2 == 3:
    print("Yes")
else:
    print("No")
Buggy code:
a = []
for i in range(3):
    a.append(list(map(int, input().split())))

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

ans = 0
for i in range(3):
    if a[0][i] == a[1][i] == a[2][i] == 0:
        ans = 1
    elif a[i][0] == a[i][1] == a[i][2] == 0:
        ans = 1
if a[0][0] == a[1][1] == a[2][2] == 0:
    ans = 1
if a[0][3] == a[1][1] == a[2][0] == 0:
    ans = 1
if ans == 1:
    print("Yes")
else:
    print("No")


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

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

ans = 0
for i in range(3):
    if a[0][i] == a[1][i] == a[2][i] == 0:
        ans = 1
    elif a[i][0] == a[i][1] == a[i][2] == 0:
        ans = 1
if a[0][0] == a[1][1] == a[2][2] == 0:
    ans = 1
if a[0][2] == a[1][1] == a[2][0] == 0:
    ans = 1

if ans == 1:
    print("Yes")
else:
    print("No")
Buggy code:
f = list(map(int, input().split()))
s = list(map(int, input().split()))
t = list(map(int, input().split()))
n = int(input())
k = []
for i in range(n):
    k.append(int(input()))

lis = []

lis.append(f)
lis.append(s)
lis.append(t)

ans = 0

for i in lis:
    c =0
    for n in range(len(i)):
        if i[n] in k:
            i[n] = 'X'
            c += 1
            if c == 3:
                ans +=1
                break

if f[0] == 'X' and s[0] == 'X' and t[0] == 'X':
    ans +=1
elif f[1] == 'X' and s[1] == 'X' and t[1] == 'X':
    ans += 1
elif f[2] == 'X' and s[2] == 'X' and t[2] == 'X':
    ans += 1
elif f[0] == 'X' and s[1] == 'X' and t[3] == 'X':
    ans += 1
elif f[3] == 'X' and s[2] == 'X' and t[1] == 'X':
    ans += 1
    
if ans < 1:
    print('Yes')
else:
    print('No')

Fixed code:
f = list(map(int, input().split()))
s = list(map(int, input().split()))
t = list(map(int, input().split()))
n = int(input())
k = []
for i in range(n):
    k.append(int(input()))

lis = []

lis.append(f)
lis.append(s)
lis.append(t)

ans = 0

for i in lis:
    c =0
    for n in range(len(i)):
        if i[n] in k:
            i[n] = 'X'
            c += 1
            if c == 3:
                ans +=1
                break

if f[0] == 'X' and s[0] == 'X' and t[0] == 'X':
    ans +=1
elif f[1] == 'X' and s[1] == 'X' and t[1] == 'X':
    ans += 1
elif f[2] == 'X' and s[2] == 'X' and t[2] == 'X':
    ans += 1
elif f[0] == 'X' and s[1] == 'X' and t[2] == 'X':
    ans += 1
elif f[2] == 'X' and s[1] == 'X' and t[0] == 'X':
    ans += 1
    
if ans >= 1:
    print('Yes')
elif ans == 0:
    print('No')
Buggy code:
a = []
for _ in range(3):
    a.append(list(map(int,input().split()))) 
print(a)
n = int(input())
num_list = []
for _ in range(n):
    num_list.append(int(input()))
    
flg = False
for i in range(3):
    if a[i][0] in num_list and a[i][1] in num_list and a[i][2] in num_list:
        flg = True
        break
diago = list([a[0][0],a[1][1],a[2][2]])

if flg != True:
    if diago[0] in num_list and diago[1] in num_list and diago[2] in num_list:
        flg = True

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

Fixed code:
a = []
for _ in range(3):
    a.append(list(map(int,input().split()))) 
n = int(input())
num_list = []
for _ in range(n):
    num_list.append(int(input()))
    
flg = False
for i in range(3):
    if a[i][0] in num_list and a[i][1] in num_list and a[i][2] in num_list:
        flg = True
        break
        
for i in range(3):
    if a[0][i] in num_list and a[1][i] in num_list and a[2][i] in num_list:
        flg = True
        break
        
if flg != True:
    diago = list([a[0][0],a[1][1],a[2][2]])
    if diago[0] in num_list and diago[1] in num_list and diago[2] in num_list:
        flg = True
        
if flg != True:
    diago2 = list([a[2][0],a[1][1],a[2][0]])
    if diago2[0] in num_list and diago2[1] in num_list and diago2[2] in num_list:
        flg = True
        
if flg:
    print("Yes")
else:
    print("No")
Buggy code:
import sys

f = sys.stdin

l1 = f.readline().rstrip().split(" ")
l2 = f.readline().rstrip().split(" ")
l3 = f.readline().rstrip().split(" ")

mat = l1 + l2 + l3

f.readline()  #skip N
nums = []
for line in f.readlines():
    nums.append(line.rstrip())


#check
def check(kohos, n1, n2, n3):
    kohos = set(kohos)
    if n1 in kohos:
        if n2 in kohos:
            if n3 in kohos:
                #return True
                print("Yes", end="")
                quit()
    return False


#all patterns..
check(nums, mat[0], mat[1], mat[2])
check(nums, mat[3], mat[4], mat[5])
check(nums, mat[6], mat[7], mat[8])

check(nums, mat[0], mat[3], mat[6])
check(nums, mat[1], mat[4], mat[7])
check(nums, mat[2], mat[5], mat[8])

check(nums, mat[0], mat[4], mat[5])
check(nums, mat[2], mat[4], mat[6])
print("No", end="")


Fixed code:
import sys

f = sys.stdin

l1 = f.readline().rstrip().split(" ")
l2 = f.readline().rstrip().split(" ")
l3 = f.readline().rstrip().split(" ")

mat = l1 + l2 + l3

f.readline()  #skip N
nums = []
for line in f.readlines():
    nums.append(line.rstrip())


#check
def check(kohos, n1, n2, n3):
    kohos = set(kohos)
    if n1 in kohos:
        if n2 in kohos:
            if n3 in kohos:
                #return True
                print("Yes", end="")
                quit()
    return False


#all patterns..
check(nums, mat[0], mat[1], mat[2])
check(nums, mat[3], mat[4], mat[5])
check(nums, mat[6], mat[7], mat[8])

check(nums, mat[0], mat[3], mat[6])
check(nums, mat[1], mat[4], mat[7])
check(nums, mat[2], mat[5], mat[8])

check(nums, mat[0], mat[4], mat[8])
check(nums, mat[2], mat[4], mat[6])
print("No", end="")
Buggy code:
a=[map(int,input().split() for _ in range(3)]
n=int(input())
b=[int(input()) for _ in range(n)]
used=[[False]*3 for _ in range(3)]
for k in range(n):
    for i in range(3):
        for j in range(3):
            if a[i][j]==b[k]:
                used[i][j]==True

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

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

for i in range(3):
    if a[0][2]==a[1][1]==a[2][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)]
used=[[False]*3 for _ in range(3)]
for k in range(n):
    for i in range(3):
        for j in range(3):
            if a[i][j]==b[k]:
                used[i][j]=True

for i in range(3):
    if used[0][i] and used[1][i] and used[2][i]:
        print("Yes")
        exit()
        
for i in range(3):
    if used[i][0] and used[i][1] and used[i][2]:
        print("Yes")
        exit()

if used[0][0] and used[1][1] and used[2][2]:
        print("Yes")
        exit()

if used[0][2] and used[1][1] and used[2][0]:
        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()))
a=[a1,a2,a3]
n=int(input())
q=[[0,0,0],[0,0,0],[0,0,0]]
b=[]
b=[int(input()) for i in range(n)]
for i in b:
    for c in range(3):
        for x in range(3):
            if b==a[c][x]:
                q[c][x]==1

result='No'
for t in range(3):
    if q[t][0]==q[t][1]==q[t][2]==1:
        result='Yes'
    elif q[0][t]==q[1][t]==q[2][t]==1:
        result='Yes'
    elif q[0][0]==q[1][1]==q[2][2]==1:
        result='Yes'
    elif q[0][2]==q[1][1]==q[2][0]==1:
        result='Yes'
print(result)


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())
q=[[0,0,0],[0,0,0],[0,0,0]]
for i in range(n):
    b=int(input())
    for c in range(3):
        for x in range(3):
            if b==a[c][x]:
                q[c][x]=1

result='No'
for t in range(3):
    if q[t][0]==q[t][1]==q[t][2]==1:
        result='Yes'
        break
    elif q[0][t]==q[1][t]==q[2][t]==1:
        result='Yes'
        break
if q[0][0]==q[1][1]==q[2][2]==1:
    result='Yes'
elif q[0][2]==q[1][1]==q[2][0]==1:
        result='Yes'

print(result)