qyliang/CodeNanoFix huggingface dataset:
Buggy code:
x1   = list(map(int, input().split()))
x2   = list(map(int, input().split()))
x3   = list(map(int, input().split()))
card = [x1, x2, x3]

numLen  = int(input())
numList = [int(input()) for _ in range(numLen)]
ans = "No"
for x in range(3):
    for y in range(3):
        for numList_i in range(numLen):
            if card[x][y] == numList[numList_i]:
                print(numList[numList_i])
                card[x][y] = "x"

for i in range(3):
    if card[i][0] == "x" and card[i][1] == "x" and card[i][2] == "x":
        ans = "Yes"
    if card[0][i] == "x" and card[1][i] == "x" and card[2][i] == "x":
        ans = "Yes"

if card[0][0] == "x" and card[1][1] == "x" and card[2][2] == "x":
    ans = "Yes"
if card[0][2] == "x" and card[1][1] == "x" and card[2][0] == "x":
    ans = "Yes"
print(ans)




Fixed code:
x1   = list(map(int, input().split()))
x2   = list(map(int, input().split()))
x3   = list(map(int, input().split()))
card = [x1, x2, x3]

numLen  = int(input())
numList = [int(input()) for _ in range(numLen)]
ans = "No"
for x in range(3):
    for y in range(3):
        for numList_i in range(numLen):
            if card[x][y] == numList[numList_i]:
                card[x][y] = "x"

for i in range(3):
    if card[i][0] == "x" and card[i][1] == "x" and card[i][2] == "x":
        ans = "Yes"
    if card[0][i] == "x" and card[1][i] == "x" and card[2][i] == "x":
        ans = "Yes"

if card[0][0] == "x" and card[1][1] == "x" and card[2][2] == "x":
    ans = "Yes"
if card[0][2] == "x" and card[1][1] == "x" and card[2][0] == "x":
    ans = "Yes"
print(ans)
Buggy code:
a=[list(map(int,input().split())) for i in range(3)]
n=int(input())
b=[input() for i in range(n)]
for i in range(3):
  for j in range(3):
    for k in range(n):
      if b[k]==a[i][j]:
        a[i][j]=0
if (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]) or (a[0][2]==0 and a[1][2]==0 and a[2][2]) or a[0]==[0,0,0] or a[1]==[0,0,0] or a[2]==[0,0,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=[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):
  for j in range(3):
    for k in range(n):
      if b[k]==a[i][j]:
        a[i][j]=0
if (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,0] or a[1]==[0,0,0] or a[2]==[0,0,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:
S = [input().split() for i in range(3)]
N = int(input())
b = [int(i) for i in input().split()]
check = 0

for num in b:
    for i in range(3):
        for j in range(3):
            if S[i][j] == num:
                S[i][j] = '*'

if len(set(S[0])) == 1 or len(set(S[1])) == 1 or len(set(S[2])) == 1:
    check = 1

for i in range(3):
    cnt = 0
    for j in range(3):
        if S[j][i] == '*':
            cnt += 1
    if cnt == 3:
        check = 1

if S[0][0] == S[1][1] == S[2][2] == '*' or S[0][2] == S[1][1] == S[2][0] == '*':
    check = 1

if check == 1:
    print('Yes')
else:
    print('No')

print(S)

Fixed code:
S = [[int(i) for i in input().split()] for i in range(3)]
N = int(input())
b = [int(input()) for i in range(N)]
check = 0

for num in b:
    for i in range(3):
        for j in range(3):
            if S[i][j] == num:
                S[i][j] = '*'

if len(set(S[0])) == 1 or len(set(S[1])) == 1 or len(set(S[2])) == 1:
    check = 1

for i in range(3):
    cnt = 0
    for j in range(3):
        if S[j][i] == '*':
            cnt += 1
    if cnt == 3:
        check = 1

if S[0][0] == S[1][1] == S[2][2] == '*' or S[0][2] == S[1][1] == S[2][0] == '*':
    check = 1

if check == 1:
    print('Yes')
else:
    print('No')
Buggy code:
a = [list(map(int,input().split())) for l in range(3)]
n = int(input())
b = [int(input()) for l in range(n)]
print(b)
for k in range(n):
  for i in range(3):
    for j in range(3):
      if a[i][j] == b[k]:
        a[i][j] = 0

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




Fixed code:
a = [list(map(int,input().split())) for l in range(3)]
n = int(input())
b = [int(input()) for l in range(n)]
for k in range(n):
  for i in range(3):
    for j in range(3):
      if a[i][j] == b[k]:
        a[i][j] = 0

ans = "No"
if a[0][0] == 0 and a[1][1] == 0 and a[2][2] == 0:
  ans = "Yes"
elif a[2][0] == 0 and a[1][1] == 0 and a[0][2] == 0:
  ans = "Yes"
else:
  for i in range(3):
    if a[i][0] == 0 and a[i][1] == 0 and a[i][2] == 0:
      ans = "Yes"
    elif a[0][i] == 0 and a[1][i] == 0 and a[2][i] == 0:
      ans ="Yes"
print(ans)
Buggy code:
row1=list(map(int,input().split()))
row2=list(map(int,input().split()))
row3=list(map(int,input().split()))
bingo=row1+row2+row3
num=int(input())
num_list=set()
for i in range(num):
  num_list.add(int(input()))

bingo_list=[[0,3,6],[1,4,7],[2,5,8],[0,1,2],[3,4,5],[6,7,8],[0,4,8],[2,4,6]]
  
for i in num_list:
  if i in bingo:
    bingo[bingo.index(i)] = True

for i in bingo_list:
  if bingo[i[0]] is True and bingo[i[1]] is True and bingo[i[2]] is True:
    print('Yes')
    return 0

print('No')


Fixed code:
row1=list(map(int,input().split()))
row2=list(map(int,input().split()))
row3=list(map(int,input().split()))
bingo=row1+row2+row3
num=int(input())
num_list=set()
for i in range(num):
  num_list.add(int(input()))

bingo_list=[[0,3,6],[1,4,7],[2,5,8],[0,1,2],[3,4,5],[6,7,8],[0,4,8],[2,4,6]]
num_list=list(num_list)
for i in num_list:
  if i in bingo:
    bingo[bingo.index(i)] = True

for i in bingo_list:
  if bingo[i[0]] ==True and bingo[i[1]] == True and bingo[i[2]] == True:
    print('Yes')
    break
  if i == [2,4,6]:
    print('No')
Buggy code:
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))
d = [a[0],b[0],c[0]]
e = [a[1],b[1],c[1]]
f = [a[2],b[2],c[2]]
g = [a[0],b[1],c[2]]
h = [a[2],b[1],c[0]]

n = int(input())

bs = []
for _ in int(input(range(n))):
             bs.append(int(input())
       
for l in [a,b,c,d,e,f,g,h]
             if (l[0] in bs) and (l[1] in bs) and (l[2] in bs):
             print("Yes")
             break
else:
             print("No")

Fixed code:
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))
d = [a[0],b[0],c[0]]
e = [a[1],b[1],c[1]]
f = [a[2],b[2],c[2]]
g = [a[0],b[1],c[2]]
h = [a[2],b[1],c[0]]

n = int(input())

bs = []
for _ in range(n):
    bs.append(int(input()))

for l in [a,b,c,d,e,f,g,h]:
    if (l[0] in bs) and (l[1] in bs) and (l[2] in bs):
        print("Yes")
        break
else:
        print("No")
Buggy code:
a = input().split()
a += input().split()
a += input().split()
n = int(input())
b = set([(input()) for i in range(n)])

bingo = False
if set([a[0], a[1], a[2]]).issubset(b):
	bingo = True
if set([a[3], a[4], a[5]]).issubset(b):
	bingo = True
if set([a[6], a[7], a[8]]).issubset(b):
	bingo = True
if set([a[0], a[3], a[6]]).issubset(b):
	bingo = True
if set([a[1], a[4], a[7]]).issubset(b):
	bingo = True
if set([a[2], a[5], a[8]]).issubset(b):
	bingo = True
if set([a[0], a[4], a[8]]).issubset(b):
	bingo = True
if set([a[2], a[4], a[6]]).issubset(b):
	bingo = True
if bingo:
  print("Yes")
print("No")  

Fixed code:
a = input().split()
a += input().split()
a += input().split()
n = int(input())
b = set([(input()) for i in range(n)])

bingo = False
if set([a[0], a[1], a[2]]).issubset(b):
	bingo = True
if set([a[3], a[4], a[5]]).issubset(b):
	bingo = True
if set([a[6], a[7], a[8]]).issubset(b):
	bingo = True
if set([a[0], a[3], a[6]]).issubset(b):
	bingo = True
if set([a[1], a[4], a[7]]).issubset(b):
	bingo = True
if set([a[2], a[5], a[8]]).issubset(b):
	bingo = True
if set([a[0], a[4], a[8]]).issubset(b):
	bingo = True
if set([a[2], a[4], a[6]]).issubset(b):
	bingo = True
if bingo:
  print("Yes")
else:
  print("No")
Buggy code:
line1 = list(map(int,input().split()) )
line2 = list(map(int,input().split()))
line3 = list(map(int,input().split()))

N = int(input())
num = []
for _ in range(N):
    num.append(int(input()))
card = line1 + line2 + line3
result = []
for i in card:
    if i in num:
        result.append(1)
    else:
        result.append(0)
count = 0
for i in range(0,7,3):
    if result[i] == 1 and result[i + 1] == 1 and result[i + 2] == 1:
        count = 1
        print("Yes")
if count == 0:
    for i in range(3):
        if result[i] == 1 and result[i+3] == 1 and result[i+6] == 1:
            count = 1
            print("Yes")
if count == 0:
    if result[0] == result[4] == result[8] == 1:
        count = 1
        print("Yes")
if count == 0:
    if result[2] == result[4] == result[6] == 1:
        print('Yes')
    else:
        print('No')

Fixed code:
line1 = list(map(int,input().split()) )
line2 = list(map(int,input().split()))
line3 = list(map(int,input().split()))

N = int(input())
num = []
for _ in range(N):
    num.append(int(input()))
card = line1 + line2 + line3
result = []
for i in card:
    if i in num:
        result.append(1)
    else:
        result.append(0)
count = 0


for i in range(0,7,3):
    if result[i] == 1 and result[i + 1] == 1 and result[i + 2] == 1:
        count = 1
        print("Yes")
        break
if count == 0:
    for i in range(3):
        if result[i] == 1 and result[i+3] == 1 and result[i+6] == 1:
            count = 1
            print("Yes")
            break
if count == 0:
    if result[0] == result[4] == result[8] == 1:
        count = 1
        print("Yes")
        
if count == 0:
    if result[2] == result[4] == result[6] == 1:
        print('Yes')
    else:
        print('No')
Buggy code:
import numpy as np

a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
c = [int(x) for x in input().split()]

list_ = set(a+b+c)
n = int(input())

a = np.array([a, b, c])

for _ in range(n):
  x = int(input())
  if x in list_:
    a = np.where(a==x,0,a)
if np.sum(a==0) < 3:
  print('No')
  quit()

for i in range(3):
  if sum(a[:,i]) == 0:
    print('Yes')
    quit()

for i in range(3):
  if sum(a[i,:]) == 0:
    print('Yes')
    quit()

if a[0,0]+a[1,1]+a[2,2] == 0 or a[0,2]+a[1,1]+a[2,0] == 0:
  print('Yes')

print('No')

Fixed code:
import numpy as np

a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
c = [int(x) for x in input().split()]

list_ = set(a+b+c)
n = int(input())

a = np.array([a, b, c])

for _ in range(n):
  x = int(input())
  if x in list_:
    a = np.where(a==x,0,a)

if np.sum(a==0) < 3:
  print('No')
  quit()

for i in range(3):
  if sum(a[:,i]) == 0:
    print('Yes')
    quit()

for i in range(3):
  if sum(a[i,:]) == 0:
    print('Yes')
    quit()

if a[0,0]+a[1,1]+a[2,2] == 0 or a[0,2]+a[1,1]+a[2,0] == 0:
  print('Yes')
  quit()

print('No')
Buggy code:
a1=input("").split(" ")
a2=input("").split(" ")
a3=input("").split(" ")
lista=[]
listmp=[]
for k in range(3):
    listmp+=[int(a1[i])]
lista+=[listmp]
listmp=[]
for k in range(3):
    listmp+=[int(a2[i])]
lista+=[listmp]
listmp=[]
for k in range(3):
    listmp+=[int(a3[i])]
lista+=[listmp]
n=int(input(""))
listn=[]
for i in range(n):
    t=int(input(""))
    listn+=[t]
for i in range(3):
    for k in range(3):
        if(lista[i][k] in listn):
            lista[i][k]=0
p=0
for i in range(3):
    s=0
    for k in range(3):
        s+=lista[i][k]

        if(s==0):
            p=1
for i in range(3):
    s=0
    for k in range(3):
        s+=lista[k][i]

        if(s==0):
            p=1
s=0
for i in range(3):
    s+=lista[i][i]
if(s==0):
    p=1
s=0
for i in range(3):
    s+=lista[i][2-i]
if(s==0):
    p=1
if(p==1):
    print("Yes")
else:
    print("No")
    
    

    

Fixed code:
a1=input("").split(" ")
a2=input("").split(" ")
a3=input("").split(" ")
lista=[]
listmp=[]
for k in range(3):
    listmp+=[int(a1[k])]
lista+=[listmp]
listmp=[]
for k in range(3):
    listmp+=[int(a2[k])]
lista+=[listmp]
listmp=[]
for k in range(3):
    listmp+=[int(a3[k])]
lista+=[listmp]
n=int(input(""))
listn=[]
for i in range(n):
    t=int(input(""))
    listn+=[t]
for i in range(3):
    for k in range(3):
        if(lista[i][k] in listn):
            lista[i][k]=0
p=0
for i in range(3):
    s=0
    for k in range(3):
        s+=lista[i][k]

    if(s==0):
            p=1
for i in range(3):
    s=0
    for k in range(3):
        s+=lista[k][i]

    if(s==0):
            p=1
s=0
for i in range(3):
    s+=lista[i][i]
if(s==0):
    p=1
s=0
for i in range(3):
    s+=lista[i][2-i]
if(s==0):
    p=1
if(p==1):
    print("Yes")
else:
    print("No")
Buggy code:
a = [list(map(int, input().split())) for i in range(3)]

n = int(input())

k = [int(input()) for p in range(n)]
for s in a:
    if s[0] in k or s[1] in k or s[2] in k:
        print("Yes")
        exit()

for s in range(3):
    if a[0][s] in k or a[1][s] in k or a[2][s]:
        print("Yes")
        exit()

if a[0][0] in k and a[1][1] in k and a[2][2] in k:
    print("Yes")
    exit()

if a[0][2] in k and a[1][1] in k and a[2][0] in k:
    print("Yes")
    exit()

print("No")

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

n = int(input())

k = [int(input()) for p in range(n)]
for s in range(3):
    if a[s][0] in k and a[s][1] in k and a[s][2] in k:
        print("Yes")
        exit()

for t in range(3):
    if a[0][t] in k and a[1][t] in k and a[2][t] in k:
        print("Yes")
        exit()

if a[0][0] in k and a[1][1] in k and a[2][2] in k:
    print("Yes")
    exit()

if a[0][2] in k and a[1][1] in k and a[2][0] in k:
    print("Yes")
    exit()

print("No")
Buggy code:
from sys import stdin,exit
import  numpy as np
A = [stdin.readline().rstrip().split() for _ in range(3)]
sum(A,[])
n = int(stdin.readline().rstrip())
B= [stdin.readline().rstrip().split() for _ in range(n)]
if len(B)<=2:
    print("No")
    sys.exit()
for i in range(len(B)):
    try:
        A[A.index(B[i])]=0
    except:
        continue
if A[1]+A[2]+A[3]==0 or A[1]+A[4]+A[7]==0 or A[3]+A[5]+A[7]==0 or A[4]+A[5]+A[6]==0 or A[2]+A[5]+A[8]==0 or A[1]+A[5]+A[9]==0 or A[7]+A[8]+A[9]==0 or A[3]+A[6]+A[9]==0:
    print("Yes")
else:
    print("No")

Fixed code:
from sys import stdin,exit
import  numpy as np
A = [stdin.readline().rstrip().split() for _ in range(3)]
A=sum(A,[])
n = int(stdin.readline().rstrip())
B= [stdin.readline().rstrip().split() for _ in range(n)]
B=sum(B,[])
if len(B)<=2:
    print("No")
    sys.exit()
for i in range(len(B)):
    try:
        A[A.index(B[i])]=0
    except:
        continue
A=[int(i) for i in A]
if A[1]+A[2]+A[0]==0 or A[0]+A[3]+A[6]==0 or A[2]+A[4]+A[6]==0 or A[3]+A[4]+A[5]==0 or A[1]+A[4]+A[7]==0 or A[0]+A[4]+A[8]==0 or A[6]+A[7]+A[8]==0 or A[2]+A[5]+A[8]==0:
    print("Yes")
else:
    print("No")
Buggy code:
import sys

def main():
    a=[]
    b=[]
    c=[]
    for i in range(3):
        tmp = input().replace('\n','').split(' ')
        tmp = list(map(int, tmp))
        a.append([tmp[0],False])
        a.append([tmp[1],False])
        a.append([tmp[2],False])
        c.append(tmp[0])
        c.append(tmp[1])
        c.append(tmp[2])
    n = int(input().replace('\n',''))
    for i in range(n):
        try:
            tmp = c.index(int(input().replace('\n','')))
            a[tmp][1] = True
        except ValueError:
            pass
    for i in range(3):
        if a[i][1] and a[i+3][1] and a[i+6][1]:
            res = 'Yes'
            break
        elif a[i*3][1] and a[i*3+1][1] and a[i*3+2][1]:
            res = 'Yes'
            break
        elif a[0][1] and a[4][1] and a[7][1] or a[2][1] and a[4][1] and a[6][1]:
            res = 'Yes'
            break
        else:
            res = 'No'
            break
    print(res)
if __name__ == '__main__':
    input = sys.stdin.readline
    main()

Fixed code:
import sys

def main():
    a=[]
    b=[]
    c=[]
    for i in range(3):
        tmp = input().replace('\n','').split(' ')
        tmp = list(map(int, tmp))
        a.append([tmp[0],False])
        a.append([tmp[1],False])
        a.append([tmp[2],False])
        c.append(tmp[0])
        c.append(tmp[1])
        c.append(tmp[2])
    n = int(input().replace('\n',''))
    for i in range(n):
        try:
            tmp = c.index(int(input().replace('\n','')))
            a[tmp][1] = True
        except ValueError:
            pass
    for i in range(3):
        if a[i][1] and a[i+3][1] and a[i+6][1]:
            res = 'Yes'
            break
        elif a[i*3][1] and a[i*3+1][1] and a[i*3+2][1]:
            res = 'Yes'
            break
        elif a[0][1] and a[4][1] and a[8][1] or a[2][1] and a[4][1] and a[6][1]:
            res = 'Yes'
            break
        else:
            res = 'No'
    print(res)
if __name__ == '__main__':
    input = sys.stdin.readline
    main()
Buggy code:
a = [list(map(int, input().split())) for _ in range(3)]
n = int(input())
b = [int(input()) for _ in range(n)]
bingo = [[0 for _ in range(3)] for _ in range(3)]
print(bingo)
for i in range(n):
    for j in range(3):
        for k in range(3):
            if a[j][k] == b[i]:
                bingo[j][k] = True
if (bingo[0][0] and bingo[1][0] and bingo[2][0]) or (bingo[0][1] and bingo[1][1] and bingo[2][1]) or (bingo[0][2] and bingo[1][2] and bingo[2][2]):
    print('Yes')
elif (bingo[0][0] and bingo[0][1] and bingo[0][2]) or (bingo[1][0] and bingo[1][1] and bingo[1][2]) or (bingo[2][0] and bingo[2][1] and bingo[2][2]):
    print('Yes')
elif (bingo[0][0] and bingo[1][1] and bingo[2][2]) or (bingo[0][2] and bingo[1][1] and bingo[2][0]):
    print('Yes')
else:
    print('No')


Fixed code:
a = [list(map(int, input().split())) for _ in range(3)]
n = int(input())
b = [int(input()) for _ in range(n)]
bingo = [[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 a[j][k] == b[i]:
                bingo[j][k] = True
if (bingo[0][0] and bingo[1][0] and bingo[2][0]) or (bingo[0][1] and bingo[1][1] and bingo[2][1]) or (bingo[0][2] and bingo[1][2] and bingo[2][2]):
    print('Yes')
elif (bingo[0][0] and bingo[0][1] and bingo[0][2]) or (bingo[1][0] and bingo[1][1] and bingo[1][2]) or (bingo[2][0] and bingo[2][1] and bingo[2][2]):
    print('Yes')
elif (bingo[0][0] and bingo[1][1] and bingo[2][2]) or (bingo[0][2] and bingo[1][1] and bingo[2][0]):
    print('Yes')
else:
    print('No')
Buggy code:
import sys
input = sys.stdin.readlines()
nums = []
[[nums.append(num) for num in row.strip().split(" ")] for row in input[:3]]
bs = [i.strip() for i in input[4:]]
mat = [num in bs for num in nums]
patterns = [[0, 1, 2],
            [0, 4, 8],
            [0, 3, 6],
            [1, 4, 7],
            [2, 4, 6],
            [2, 5, 8],
            [3, 4, 5],
            [6, 7, 8]]
for pat in patterns:
    if mat[pat[0]] and mat[pat[1]] and mat[pat[2]]:
        print("Yes")

Fixed code:
import sys
input = sys.stdin.readlines()
nums = []
[[nums.append(num) for num in row.strip().split(" ")] for row in input[:3]]
bs = [i.strip() for i in input[4:]]
mat = [num in bs for num in nums]
patterns = [[0, 1, 2],
            [0, 4, 8],
            [0, 3, 6],
            [1, 4, 7],
            [2, 4, 6],
            [2, 5, 8],
            [3, 4, 5],
            [6, 7, 8]]
for pat in patterns:
    if mat[pat[0]] and mat[pat[1]] and mat[pat[2]]:
        print("Yes")
        sys.exit()
print("No")
Buggy code:
mat=[]

for i in range(3):
    inp = [int(x) for x in input().split()]
    mat.append(inp)
    
n = int(input())

for _ in range(n):
    q = int(input())
    for i in range(3):
        if q in mat[i]:
            ind = mat[i].index(q)
            mat[i][ind] = '1'
            break
    
if mat[0][0]=='1' and mat[0][1]=='1' and mat[0][2]=='1':
    print('YES')
    
elif mat[1][0]=='1' and mat[1][1]=='1' and mat[1][2]=='1':
    print('YES')

elif mat[2][0]=='1' and mat[2][1]=='1' and mat[2][2]=='1':
    print('YES')

#col
elif mat[0][0]=='1' and mat[1][0]=='1' and mat[2][0]=='1':
    print('YES')

elif mat[0][1]=='1' and mat[1][1]=='1' and mat[2][1]=='1':
    print('YES')

elif mat[0][2]=='1' and mat[1][2]=='1' and mat[2][2]=='1':
    print('YES')

#diag
elif mat[0][0]=='1' and mat[1][1]=='1' and mat[2][2]=='1':
    print('YES')

elif mat[0][2]=='1' and mat[1][1]=='1' and mat[2][0]=='1':
    print('YES')
else:
    print('NO')
    

Fixed code:
mat=[]

for i in range(3):
    inp = [int(x) for x in input().split()]
    mat.append(inp)
    
n = int(input())

for _ in range(n):
    q = int(input())
    for i in range(3):
        if q in mat[i]:
            ind = mat[i].index(q)
            mat[i][ind] = '1'
            break
    
if mat[0][0]=='1' and mat[0][1]=='1' and mat[0][2]=='1':
    print('Yes')
    
elif mat[1][0]=='1' and mat[1][1]=='1' and mat[1][2]=='1':
    print('Yes')

elif mat[2][0]=='1' and mat[2][1]=='1' and mat[2][2]=='1':
    print('Yes')

#col
elif mat[0][0]=='1' and mat[1][0]=='1' and mat[2][0]=='1':
    print('Yes')

elif mat[0][1]=='1' and mat[1][1]=='1' and mat[2][1]=='1':
    print('Yes')

elif mat[0][2]=='1' and mat[1][2]=='1' and mat[2][2]=='1':
    print('Yes')

#diag
elif mat[0][0]=='1' and mat[1][1]=='1' and mat[2][2]=='1':
    print('Yes')

elif mat[0][2]=='1' and mat[1][1]=='1' and mat[2][0]=='1':
    print('Yes')
else:
    print('No')
Buggy code:
li1 = list(map(int,input().split()))
li2 = list(map(int,input().split()))
li3 = list(map(int,input().split()))
N = int(input())
b = [int(input()) for i in range(N)]
A = li1+li2+li3

hit = []
for i in b:
    if i in A:
        hit.append(A.index(i)+1)

if (1 in hit and 2 in hit and 3 in hit)\
or (4 in hit and 5 in hit and 6 in hit)\
or (7 in hit and 8 in hit and 9 in hit)\
or (1 in hit and 4 in hit and 7 in hit)\
or (2 in hit and 5 in hit and 8 in hit)\
or (3 in hit and 6 in hit and 9 in hit)\
or (1 in hit and 5 in hit and 9 in hit)\
or (3 in hit and 5 in hit and 7 in hit):
    print("Tes")
else:
    print("No")

Fixed code:
li1 = list(map(int,input().split()))
li2 = list(map(int,input().split()))
li3 = list(map(int,input().split()))
N = int(input())
b = [int(input()) for i in range(N)]
A = li1+li2+li3

hit = []
for i in b:
    if i in A:
        hit.append(A.index(i)+1)

if (1 in hit and 2 in hit and 3 in hit)\
or (4 in hit and 5 in hit and 6 in hit)\
or (7 in hit and 8 in hit and 9 in hit)\
or (1 in hit and 4 in hit and 7 in hit)\
or (2 in hit and 5 in hit and 8 in hit)\
or (3 in hit and 6 in hit and 9 in hit)\
or (1 in hit and 5 in hit and 9 in hit)\
or (3 in hit and 5 in hit and 7 in hit):
    print("Yes")
else:
    print("No")
Buggy code:
bingo=[list(map(int,input().split())) for i in range(3)]
N=int(input())
number=[list(map(int,input().split())) for i in range(N)]

#print(bingo)
#print(number)
check=[0,0,0,0,0,0,0,0,0]
ans=0
for i in range(N):
    for j in range(3):
        for k in range(3):
            if number[i]==bingo[j][k]:
                check[3*j+k]=1
                
                
                
for i in range(3):
    if check[0+3*i]==check[1+3*i]==check[2+3*i]==1:
        ans=1
    if check[j]==check[j+3]==check[j+6]==1:
        ans=1
        
if check[0]==check[4]==check[8]==1:
    ans=1
if check[2]==check[4]==check[6]==1: 
    ans=1
    
if ans==1:
    print("Yes")
else:
    print("No")
    

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

#print(bingo)
#print(number)
check=[0,0,0,0,0,0,0,0,0]
ans=0
for i in range(N):
    for j in range(3):
        for k in range(3):
            if number[i][0]==bingo[j][k]:
                check[3*j+k]=1
                
                
                
for i in range(3):
    if check[0+3*i]==check[1+3*i]==check[2+3*i]==1:
        ans=1
    if check[i]==check[i+3]==check[i+6]==1:
        ans=1
        
if check[0]==check[4]==check[8]==1:
    ans=1
if check[2]==check[4]==check[6]==1: 
    ans=1
    
if ans==1:
    print("Yes")
else:
    print("No")
    
#print(check)