qyliang/CodeNanoFix huggingface dataset:
Buggy code:
al = [list(map(int, input().split())) for i in range(3)]
al = sum(a, [])
n = int(input())
bl = [int(input()) for i in range(n)]
check = [0 for i in range(9)]

for b in bl:
    if b in al:
        check[al.index(b)] = 1

if [1,1,1] in [check[:3], check[3:6], check[6:], check[0:7:3], check[1:8:3], check[2:9:3], check[0:9:4], check[3:8:2]]:
    print("Yes")
else:
    print("No")

Fixed code:
al = [list(map(int, input().split())) for i in range(3)]
al = sum(al, [])
n = int(input())
bl = [int(input()) for i in range(n)]
check = [0 for i in range(9)]

for b in bl:
    if b in al:
        check[al.index(b)] = 1

if [1,1,1] in [check[:3], check[3:6], check[6:], check[0:7:3], check[1:8:3], check[2:9:3], check[0:9:4], check[2:8:2]]:
    print("Yes")
else:
    print("No")
Buggy code:
for _ in range(3):
  A　+= list(map(int,input().split()))
N = int(input())
B = [int(input()) for _ in range(N)]
C = [0]*9
for i in B:
  if i in A:
    x = A.index(i)
    C[x] = 1
if C[0]*C[1]*C[2] == 1 or C[3]*C[4]*C[5]==1 or C[6]*C[7]*C[8] ==1 or C[0]*C[3]*C[6] ==1 or C[1]*C[4]*C[7]==1 or C[2]*C[5]*C[8] ==1 or C[0]*C[4]*C[8] ==1 or C[2]*C[4]*C[6] ==1:
  print("Yes")
else:
  print("No")
  


Fixed code:
A = []
for _ in range(3):
  A += list(map(int,input().split()))
N = int(input())
B = [int(input()) for _ in range(N)]
C = [0]*9
for i in B:
  if i in A:
    x = A.index(i)
    C[x] = 1
if C[0]*C[1]*C[2] == 1 or C[3]*C[4]*C[5]==1 or C[6]*C[7]*C[8] ==1 or C[0]*C[3]*C[6] ==1 or C[1]*C[4]*C[7]==1 or C[2]*C[5]*C[8] ==1 or C[0]*C[4]*C[8] ==1 or C[2]*C[4]*C[6] ==1:
  print("Yes")
else:
  print("No")
Buggy code:
A = [list(map(int, input().split())) for i in range(3)]
N = int(input())
d = [[0]*3]*3
for i in range(3):
  for j in range(3):
    b = int(input())
    if A[i][j] == b:
      d[i][j] = 1

ans = "No"

for i in range(3):
  if sum(d[i]) == 3:
    ans = "Yes"
    break
  if sum([D[i] for D in d]) == 3:
    ans = "Yes"
    break
if sum([d[i][i] for i in range(3)]) == 3:
  ans = "Yes"

if sum([d[i][2 - i] for i in range(3)]) == 3:
  ans = "Yes"
  
print(ans)

	
    
  

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

for  _ in range(N):
  b = int(input())
  for i in range(3):
    for j in range(3):
      if A[i][j] == b:
        d[i][j] = 1
        
ans = "No"
 
for i in range(3):
  if sum(d[i]) == 3:
    ans = "Yes"
    break
  if sum([D[i] for D in d]) == 3:
    ans = "Yes"
    break
if sum([d[i][i] for i in range(3)]) == 3:
  ans = "Yes"
 
if sum([d[i][2 - i] for i in range(3)]) == 3:
  ans = "Yes"
  
print(ans)
Buggy code:
a = [list(map(int, input().split())) for i in range(3)]
n = int(input())
b = []
for i in range(7):
    b.append(int(input()))
flag = False
for i in range(3):
    #for j in range(3):
    if a[0 + i][0] in b and a[0 + i][1] in b and a[0 + i][2] in b:
        #print('Yes')
        #quit()
        flag = True
for i in range(3):
    #for j in range(3):
    if a[0][0 + i] in b and a[1][0 + i] in b and a[2][0 + i] in b:
        #print('Yes')
        #quit()
        flag = True
        
if a[0][0] in b and a[1][1] in b and a[2][2] in b:
    #print('Yes')
    #quit()
    flag = True
if a[2][0] in b and a[1][1] in b and a[0][2] in b:
    #print('Yes')
    #quit()
    flag = True
#print('No')
if flag:
    print('Yes')
else:
    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()))
flag = False
for i in range(3):
    #for j in range(3):
    if a[0 + i][0] in b and a[0 + i][1] in b and a[0 + i][2] in b:
        #print('Yes')
        #quit()
        flag = True
for i in range(3):
    #for j in range(3):
    if a[0][0 + i] in b and a[1][0 + i] in b and a[2][0 + i] in b:
        #print('Yes')
        #quit()
        flag = True
        
if a[0][0] in b and a[1][1] in b and a[2][2] in b:
    #print('Yes')
    #quit()
    flag = True
if a[2][0] in b and a[1][1] in b and a[0][2] in b:
    #print('Yes')
    #quit()
    flag = True
#print('No')
if flag:
    print('Yes')
else:
    print('No')
Buggy code:
#N=int(input())
#N,M=map(int, input().split())
#L=list(map(int, input().split()))
L=[]
Check=[]
for n in range(9):
  Check.append(-(n+1))

for i in range(3):
  L.append(map(int, input().split()))

N=int(input())
for j in range(N):
  I=int(input())
  if I in L:
    Check[L.index(I)]=1
  
for k in range(3):
  if Check[0+3*k]==Check[1+3*k]==Check[2+3*k]:
    print('Yes')
    exit()

for l in range(3):
  if Check[0+l]==Check[3+l]==Check[6+l]:
    print('Yes')
    exit()

if Check[0]==Check[4]==Check[8] or Check[2]==Check[4]==Check[6]:
  print('Yes')
  exit()

print('No')

Fixed code:
#N=int(input())
#N,M=map(int, input().split())
#L=list(map(int, input().split()))
L=[]
Check=[]
for n in range(9):
  Check.append(-(n+1))

for i in range(3):
  NL=list(map(int, input().split()))
  L.append(NL[0])
  L.append(NL[1])
  L.append(NL[2])

N=int(input())
for j in range(N):
  I=int(input())
  if I in L:
    Check[L.index(I)]=1
  
for k in range(3):
  if Check[0+3*k]==Check[1+3*k]==Check[2+3*k]:
    print('Yes')
    exit()

for l in range(3):
  if Check[0+l]==Check[3+l]==Check[6+l]:
    print('Yes')
    exit()

if Check[0]==Check[4]==Check[8] or Check[2]==Check[4]==Check[6]:
  print('Yes')
  exit()

print('No')
Buggy code:
import numpy as np

A = []
for _ in range(3):
    A.append(list(map(int, input().split())))
N = input()
N = int(N)
B = []
for _ in range(N):
    b = input()
    B.append(int(b))
npA = np.array(A)
check = 'no'
for a in npA:
    if a[0] in B and a[1] in B and a[2] in B:
        check = 'yes'
for a in npA.T:
    if a[0] in B and a[1] in B and a[2] in B:
        check = 'yes'
dia = np.diag(npA)
if dia[0] in B and dia[1] in B and dia[2] in B:
    check = 'yes'
diaT = np.diag(np.fliplr(npA))
if diaT[0] in B and diaT[1] in B and diaT[2] in B:
    check = 'yes'
print(check)

Fixed code:
import numpy as np

A = []
for _ in range(3):
    A.append(list(map(int, input().split())))
N = input()
N = int(N)
B = []
for _ in range(N):
    b = input()
    B.append(int(b))
npA = np.array(A)
check = 'No'
for a in npA:
    if a[0] in B and a[1] in B and a[2] in B:
        check = 'Yes'
for a in npA.T:
    if a[0] in B and a[1] in B and a[2] in B:
        check = 'Yes'
dia = np.diag(npA)
if dia[0] in B and dia[1] in B and dia[2] in B:
    check = 'Yes'
diaT = np.diag(np.fliplr(npA))
if diaT[0] in B and diaT[1] in B and diaT[2] in B:
    check = 'Yes'
print(check)
Buggy code:
l=[list(map(int,input().split())) for i in ramge(3)]
N=int(input())
b=[input() for i in range(N)]
if b.count(l[0][0])>0 and b.count(l[0][1])>0 and b.count(l[0][2])>0:
    print("Yes")
    exit()
if b.count(l[1][0])>0 and b.count(l[1][1])>0 and b.count(l[1][2])>0:
    print("Yes")
    exit()
if b.count(l[2][0])>0 and b.count(l[2][1])>0 and b.count(l[2][2])>0:
    print("Yes")
    exit()
if b.count(l[0][0])>0 and b.count(l[1][0])>0 and b.count(l[2][0])>0:
    print("Yes")
    exit()
if b.count(l[0][1])>0 and b.count(l[1][1])>0 and b.count(l[2][1])>0:
    print("Yes")
    exit()
if b.count(l[0][2])>0 and b.count(l[1][2])>0 and b.count(l[2][2])>0:
    print("Yes")
    exit()
if b.count(l[0][0])>0 and b.count(l[1][1])>0 and b.count(l[2][2])>0:
    print("Yes")
    exit()
if b.count(l[0][2])>0 and b.count(l[1][1])>0 and b.count(l[2][0])>0:
    print("Yes")
    exit()
else:
    print("No")

    




Fixed code:
l=[list(map(int,input().split())) for i in range(3)]
N=int(input())
b=[int(input()) for i in range(N)]
if b.count(l[0][0])>0 and b.count(l[0][1])>0 and b.count(l[0][2])>0:
    print("Yes")
    exit()
if b.count(l[1][0])>0 and b.count(l[1][1])>0 and b.count(l[1][2])>0:
    print("Yes")
    exit()
if b.count(l[2][0])>0 and b.count(l[2][1])>0 and b.count(l[2][2])>0:
    print("Yes")
    exit()
if b.count(l[0][0])>0 and b.count(l[1][0])>0 and b.count(l[2][0])>0:
    print("Yes")
    exit()
if b.count(l[0][1])>0 and b.count(l[1][1])>0 and b.count(l[2][1])>0:
    print("Yes")
    exit()
if b.count(l[0][2])>0 and b.count(l[1][2])>0 and b.count(l[2][2])>0:
    print("Yes")
    exit()
if b.count(l[0][0])>0 and b.count(l[1][1])>0 and b.count(l[2][2])>0:
    print("Yes")
    exit()
if b.count(l[0][2])>0 and b.count(l[1][1])>0 and b.count(l[2][0])>0:
    print("Yes")
    exit()
else:
    print("No")
Buggy code:
listA = []
import itertools
listB = [0] * 9
for i in range(3):
    listA.append(input().split())
listA = list(itertools.chain.from_iterable(listA))
N = int(input())
for i in range(N):
    B = input()
    if B in listA:
        listB[listA.index(B)] = 1
listB = [1,1,0,1,0,0,1,0,0]
for i in range(3):
    if listB[i*3] == 1 and listB[i*3+1] == 1 and listB[i*3+2] == 1:
        print("Yes")
        exit()
for i in range(3):
    if listB[i] == 1 and listB[i+3] == 1 and listB[i+6] == 1:
        print("Yes")
        exit()
if listB[0] == 1 and listB[4] == 1 and listB[8] == 1:
    print("Yes")
    exit()
if listB[2] == 1 and listB[4] == 1 and listB[6] == 1:
    print("Yes")
    exit()
print("No")

Fixed code:
listA = []
import itertools
listB = [0] * 9
for i in range(3):
    listA.append(input().split())
listA = list(itertools.chain.from_iterable(listA))
N = int(input())
for i in range(N):
    B = input()
    if B in listA:
        listB[listA.index(B)] = 1
for i in range(3):
    if listB[i*3] == 1 and listB[i*3+1] == 1 and listB[i*3+2] == 1:
        print("Yes")
        exit()
for i in range(3):
    if listB[i] == 1 and listB[i+3] == 1 and listB[i+6] == 1:
        print("Yes")
        exit()
if listB[0] == 1 and listB[4] == 1 and listB[8] == 1:
    print("Yes")
    exit()
if listB[2] == 1 and listB[4] == 1 and listB[6] == 1:
    print("Yes")
    exit()
print("No")
Buggy code:
#! env/bin/local python3
# -*- coding: utf-8 -*-

import numpy as np

a_1 = list(map(int, input().split()))
a_2 = list(map(int, input().split()))
a_3 = list(map(int, input().split()))
_ = input()
pickup_number = []
while True:
    try:
        pickup_number.append(int(input()))
    except EOFError:
        break

a = np.array([a_1, a_2, a_3])
print(pickup_number)
print(a)

for pn in pickup_number:
    a[a == pn] = -1

print(a)

flag = False
if np.sum(a, axis=0)[0] == -3 or np.sum(a, axis=1)[0] == -3:
    flag = True
if np.sum(a.diagonal()) == -3 or np.sum(a[0][2] + a[1][1] + a[2][2]) == -3:
    flag = True

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


Fixed code:
#! env/bin/local python3
# -*- coding: utf-8 -*-

import numpy as np

a_1 = list(map(int, input().split()))
a_2 = list(map(int, input().split()))
a_3 = list(map(int, input().split()))
_ = input()
pickup_number = []
while True:
    try:
        pickup_number.append(int(input()))
    except EOFError:
        break

a = np.array([a_1, a_2, a_3])

for pn in pickup_number:
    a[a == pn] = -1

flag = False
if -3 in np.sum(a, axis=0) or -3 in np.sum(a, axis=1):
    flag = True
if np.sum(a.diagonal()) == -3 or a[0][2] + a[1][1] + a[2][0] == -3:
    flag = True

print('Yes' if flag else 'No')
Buggy code:
bi =[list(map(int,input().split())) for i in range(3)]
n=int(input())
isok = [[0 for i in range(3)]for j in range(3)]
for i in range(n):
    x = int(input())
    for j in range(3):
        for k in range(3):
            if bi[j][k] == x:
                isok[j][k] = 1

clear = 0
for i in range(3):
    if isok[i][0] and isok[i][1] and isok[i][2]:
        clear = 1
    if isok[0][i] and isok[1][i] and isok[2][i]:
        clear = 1
if isok[0][0] and isok[1][1] and isok[2][2]:
    clear = 1
if isok[2][0] and isok[1][1] and isok[0][2]:
    clear = 1
print("Yes" if isok else "No")

Fixed code:
bi =[list(map(int,input().split())) for i in range(3)]
n=int(input())
isok = [[0 for i in range(3)]for j in range(3)]
for i in range(n):
    x = int(input())
    for j in range(3):
        for k in range(3):
            if bi[j][k] == x:
                isok[j][k] = 1

clear = 0
for i in range(3):
    if isok[i][0] and isok[i][1] and isok[i][2]:
        clear = 1
    if isok[0][i] and isok[1][i] and isok[2][i]:
        clear = 1
if isok[0][0] and isok[1][1] and isok[2][2]:
    clear = 1
if isok[2][0] and isok[1][1] and isok[0][2]:
    clear = 1
print("Yes" if clear else "No")
Buggy code:
card = [input().split(' '), input().split(' '), input().split(' ')]
count = int(input())

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

for _ in range(count):
    b = int(input())
    for i, cc in enumerate(card):
        for j, c in enumerate(cc):
            if c == b:
                result[i][j] = 1

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

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

count = int(input())

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

for _ in range(count):
    b = int(input())
    for i, cc in enumerate(card):
        for j, c in enumerate(cc):
            if c == b:
                result[i][j] = 1

for i in range(3):
    if result[i][0] == result[i][1] == result[i][2] == 1:
        print('Yes')
        exit(0)
    if result[0][i] == result[1][i] == result[2][i] == 1:
        print('Yes')
        exit(0)
if result[0][0] == result[1][1] == result[2][2] == 1:
    print('Yes')
    exit(0)
if result[0][2] == result[1][1] == result[2][0] == 1:
    print('Yes')
    exit(0)
print('No')
Buggy code:
A=[list(map(int,input().split())) for _ in range(3)]
N=int(input())
B=[int(input()) for _ in range(N)]
S=[[0,0,0] for _ in range(3)]
for b in B:
  for i in range(3):
    if b in A[i]:
      S[i][A[i].index(b)] = 1
      break
p = False
for a in S:
  if sum(a)==3:
    p = True
    break
if not p:
  for i in range(3):
    if S[0][i]+S[1][i]+S[2][i]==3:
      p = True
      break
print("Yes" if p else "No")

Fixed code:
A=[list(map(int,input().split())) for _ in range(3)]
N=int(input())
B=[int(input()) for _ in range(N)]
S=[[0,0,0] for _ in range(3)]
for b in B:
  for i in range(3):
    if b in A[i]:
      S[i][A[i].index(b)] = 1
      break
p = False
for a in S:
  if sum(a)==3:
    p = True
    break
if not p:
  for i in range(3):
    if S[0][i]+S[1][i]+S[2][i]==3:
      p = True
      break
if not p:
  if S[0][0]+S[1][1]+S[2][2]==3 or S[2][0]+S[1][1]+S[0][2]==3:
    p=True
print("Yes" if p else "No")
Buggy code:
bingo = [list(map(int,input().split())) for i in range(3)]
n = int(input())
b = [int(input()) for i in range(n)]
mas = [[0]*3]*3
ans = []
for m in range(n):
    for i in range(3):
        for j in range(3):
            if bingo[i][j] == b[m]:
                ans.append([i,j])
for i,j in ans:
    bingo[i][j] = -1
lists = []
cnt = 0

i = 0 
j = 0
if bingo[i][j] == -1 and bingo[i][j+1] == -1 and bingo[i][j+2] == -1:
                cnt -1
if bingo[i][j] == -1 and bingo[i+1][j] == -1 and bingo[i+2][j] == -1:
                cnt = 1

if bingo[0][0] == -1 and bingo[1][1] == -1 and bingo[2][2] == -1:
                cnt = 1
if bingo[0][2] == -1 and bingo[1][1] == -1 and bingo[2][0] == -1:
                cnt = 1
print(bingo)
if cnt == 1:
    print("Yes")
else:
    print("No")

        


Fixed code:
bingo = [list(map(int,input().split())) for i in range(3)]
n = int(input())
b = [int(input()) for i in range(n)]
ans = []
for m in range(n):
    for i in range(3):
        for j in range(3):
            if bingo[i][j] == b[m]:
                ans.append([i,j])
for i,j in ans:
    bingo[i][j] = -1
lists = []
cnt = 0

i = 0 
j = 0
if bingo[0][0] == -1 and bingo[0][1] == -1 and bingo[0][2] == -1:
                cnt = 1
if bingo[1][0] == -1 and bingo[1][1] == -1 and bingo[1][2] == -1:
                cnt = 1
if bingo[2][0] == -1 and bingo[2][1] == -1 and bingo[2][2] == -1:
                cnt = 1
if bingo[0][0] == -1 and bingo[1][0] == -1 and bingo[2][0] == -1:
                cnt = 1
if bingo[0][1] == -1 and bingo[1][1] == -1 and bingo[2][1] == -1:
                cnt = 1
if bingo[0][2] == -1 and bingo[1][2] == -1 and bingo[2][2] == -1:
    cnt = 1
if bingo[0][0] == -1 and bingo[1][1] == -1 and bingo[2][2] == -1:
                cnt = 1
if bingo[0][2] == -1 and bingo[1][1] == -1 and bingo[2][0] == -1:
                cnt = 1

if cnt == 1:
    print("Yes")
else:
    print("No")
Buggy code:
A = []
for i in range(3):
  A.append(list(map(int, input().split())))
B = [[0 for i in range(3)] for j in range(3)]
N = int(input())
for i in range(N):
  b = int(input())
  for j in range(3):
    for k in range(3):
      if A[j][k] == b:
        B[j][k] == 1
c = []
for i in range(3):
  c.append(B[i][0] | B[i][1] | B[i][2])
  c.append(B[0][i] | B[1][i] | B[2][i])
c.append(B[0][0] | B[1][1] | B[2][2])
c.append(B[0][2] | B[1][1] | B[2][0])
if sum(c) > 0:
  print("Yes")
else:
  print("No")

Fixed code:
A = []
for i in range(3):
  A.append(list(map(int, input().split())))
B = [[0 for i in range(3)] for j in range(3)]
N = int(input())
for i in range(N):
  b = int(input())
  for j in range(3):
    for k in range(3):
      if A[j][k] == b:
        B[j][k] = 1
c = []
for i in range(3):
  c.append(B[i][0] & B[i][1] & B[i][2])
  c.append(B[0][i] & B[1][i] & B[2][i])
c.append(B[0][0] & B[1][1] & B[2][2])
c.append(B[0][2] & B[1][1] & B[2][0])
if sum(c) > 0:
  print("Yes")
else:
  print("No")
Buggy code:
t=[]
for i in range(3):
    t.append([int(i) for i in input().split()])
n = int(input())
lst = []
for i in range(n):lst+=[int(input())]
def ligne(i):
    for j in range(3):
        if not t[i][j] in lst:
            return False
    return True
def col(j):
    for i in range(3):
        if not t[i][j] in lst:
            retur False
    return True
def diag1():
    for i in range(3):
        if not t[i][i] in lst:
            return False
    return True
def diag2():
    for i in range(3):
        if not t[2-i][i] in lst:
            return False
    return True
ans = False
for i in range(3):
    ans = ans or ligne(i)
    ans = ans or col(i)
ans  = ans or diag1() or diag2()
if ans :
    print("Yes")
else:
    print("No")

Fixed code:
t=[]
for i in range(3):
    t.append([int(i) for i in input().split()])
n = int(input())
lst = []
for i in range(n):lst+=[int(input())]
def ligne(i):
    for j in range(3):
        if not t[i][j] in lst:
            return False
    return True
def col(j):
    for i in range(3):
        if not t[i][j] in lst:
            return False
    return True
def diag1():
    for i in range(3):
        if not t[i][i] in lst:
            return False
    return True
def diag2():
    for i in range(3):
        if not t[2-i][i] in lst:
            return False
    return True
ans = False
for i in range(3):
    ans = ans or ligne(i)
    ans = ans or col(i)
ans  = ans or diag1() or diag2()
if ans :
    print("Yes")
else:
    print("No")
Buggy code:
import collections as c
import sys
input = sys.stdin.readline
ip = lambda : map(int, input().split())
mod = 10**9+7
# ##############
A = []
for i in range(3):
    A.append(list(ip()))
N = int(input())
for i in range(N):
    b = int(input())
    for j in range(3):
        for k in range(3):
            if A[j][k] == b:
                A[j][k] = 0
print(A)
if sum(A[0]) == 0 or sum(A[1]) == 0 or sum(A[2]) == 0 or (A[0][0] + A[1][0] + A[2][0] == 0) or (A[0][1] + A[1][1] + A[2][1] == 0) or (A[0][2] + A[1][2] + A[2][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')

Fixed code:
import collections as c
import sys
input = sys.stdin.readline
ip = lambda : map(int, input().split())
mod = 10**9+7
# ##############
A = []
for i in range(3):
    A.append(list(ip()))
N = int(input())
for i in range(N):
    b = int(input())
    for j in range(3):
        for k in range(3):
            if A[j][k] == b:
                A[j][k] = 0
# print(A)
if sum(A[0]) == 0 or sum(A[1]) == 0 or sum(A[2]) == 0 or (A[0][0] + A[1][0] + A[2][0] == 0) or (A[0][1] + A[1][1] + A[2][1] == 0) or (A[0][2] + A[1][2] + A[2][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:
Bingo = [ list(map(int,input().split())) for i in range(3)]
n = int(input())
num = [int(input()) for i in range(n)]
Bingo.append([Bingo[0][0] , Bingo[1][1],Bingo[2][2] ])
Bingo.append([Bingo[0][2] , Bingo[1][1],Bingo[2][0] ])
k=0
re = 'No'
for l in range(3):
  if len(list(set(num) & set(Bingo[l]))) == 3:
    re = 'Yes'
    break
print(re)

Fixed code:
Bingo = [ list(map(int,input().split())) for i in range(3)]
n = int(input())
num = [int(input()) for i in range(n)]
Bingo.append([Bingo[0][0] , Bingo[1][1],Bingo[2][2] ])
Bingo.append([Bingo[0][2] , Bingo[1][1],Bingo[2][0] ])
for k in range(3):
  Bingo.append([Bingo[0][k] , Bingo[1][k],Bingo[2][k] ])
k=0
re = 'No'
for l in range(len(Bingo)):
  if len(list(set(num) & set(Bingo[l]))) == 3:
    re = 'Yes'
    break
print(re)
Buggy code:
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
x=[[0 for i in range(3)] for j in range(3)]
N=int(input())
if N>=3:
  for i in range(N):
    b=int(input())
    for j in range(3):
      if A[j]==b:
        x[0][j]=1
      elif B[j]==b:
        x[1][j]=1
      elif C[j]==b:
        x[2][j]=1
  flag=0
  if x[0][0]==1:
    if x[0][1]==1 and x[0][2]==1:
      flag=1
    elif x[1][0]==1 and x[2][0]==1:
      flag=1
    elif x[1][1]==1 and x[2][2]==1:
      flag=1
  elif x[1][1]==1:
    if x[0][1]==1 and x[2][1]==1:
      flag=1
    elif x[1][0]==1 and x[2][0]==1:
      flag=1
    elif x[0][2]==1 and x[2][0]==1:
      flag=1
  elif x[2][2]==1:
    if x[2][0]==1 and x[2][1]==1:
      flag=1
    elif x[0][2]==1 and x[1][2]==1:
      flag=1
  if flag==1:
    print("Yes")
  else:
    print("No")
  print(x)
else:
  print("No")

Fixed code:
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
x=[[0 for i in range(3)] for j in range(3)]
N=int(input())
if N>=3:
  for i in range(N):
    b=int(input())
    for j in range(3):
      if A[j]==b:
        x[0][j]=1
      elif B[j]==b:
        x[1][j]=1
      elif C[j]==b:
        x[2][j]=1
  flag=0
  if x[0][0]==1:
    if x[0][1]==1 and x[0][2]==1:
      flag=1
    if x[1][0]==1 and x[2][0]==1:
      flag=1
    if x[1][1]==1 and x[2][2]==1:
      flag=1
  if x[1][1]==1:
    if x[0][1]==1 and x[2][1]==1:
      flag=1
    if x[1][0]==1 and x[1][2]==1:
      flag=1
    if x[0][2]==1 and x[2][0]==1:
      flag=1
  if x[2][2]==1:
    if x[2][0]==1 and x[2][1]==1:
      flag=1
    if x[0][2]==1 and x[1][2]==1:
      flag=1
  if flag==1:
    print("Yes")
  else:
    print("No")
  #print(x)
else:
  print("No")
Buggy code:
a=[]
for i in range(3):
  da=list(map(int,input().split()))
  for j in da:
    a.append(j)
n=int(input())
for i in range (n):
  b=int(input())
  for j in range(len(a)):
    if a[j] == b:
      a[j]=0

for i in range (2):
  if a[i] == a[i+3] and a[i+3]==a[i+6]:
    print('Yes')
    exit()
for i in range(2):
  if a[3*i]==a[3*i+1] and a[3*i]==a[3*i+2]:
    print('Yes')
    exit() 
if a[0]==a[4] and a[0]==a[8]:
  print('Yes')
  exit()

if a[2]==a[4] and a[2]==a[6]:
  print('Yes')
  exit()

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

for i in range (3):
  if a[i] == a[i+3] and a[i+3]==a[i+6]:
    print('Yes')
    exit()
for i in range(3):
  if a[3*i]==a[3*i+1] and a[3*i]==a[3*i+2]:
    print('Yes')
    exit() 
if a[0]==a[4] and a[0]==a[8]:
  print('Yes')
  exit()

if a[2]==a[4] and a[2]==a[6]:
  print('Yes')
  exit()
print('No')