qyliang/CodeNanoFix huggingface dataset:
Buggy code:
a=[0,0,0]
for i in range (3):
  a[i] = list(map(int,input().split()))
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

done = 0
for i in range(3):
  if a[i][0] == a[i][1] == a[i][2] == 0 or a[0][i] == a[1][i] == a[2][i] == 0 :
    done = 1
    print('Yes')

if done == 0 and (a[0][0] == a[1][1] == a[2][2] == 0 or a[0][2] == a[1][1] == a[2][0] == 0) :
  print('Yes')
  done = 1

if done == 0:
  print('No')

Fixed code:
a=[0,0,0]
for i in range (3):
  a[i] = list(map(int,input().split()))
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

done = 0
for i in range(3):
  if (a[i][0] == a[i][1] == a[i][2] == 0 or a[0][i] == a[1][i] == a[2][i] == 0) and done == 0:
    done = 1
    print('Yes')

if done == 0 and (a[0][0] == a[1][1] == a[2][2] == 0 or a[0][2] == a[1][1] == a[2][0] == 0) :
  print('Yes')
  done = 1

if done == 0:
  print('No')
Buggy code:
#!/usr/bin/env python

a = []
a.append([int(i) for i in input().split()])
a.append([int(i) for i in input().split()])
a.append([int(i) for i in input().split()])
n = int(input())
c = [[0,0,0],[0,0,0],[0,0,0]]
for i in range(n):
    b = int(input())
    for j in range(3):
        for k in range(3):
            if a[j][k] == b:
                c[j][k] = 1

print(c)
flag = False

for i in range(3):
    if c[0][i] + c[1][i] + c[2][i] == 3 and flag == False:
        print("Yes")
        flag = True
        break
    if c[i][0] + c[i][1] + c[i][2] == 3 and flag == False:
        print("Yes")
        flag = True
        break
    if c[i%3][0] + c[(i+1)%3][1] + c[(i+2)%3][2] == 3 and flag == False:
        print("Yes")
        flag = True
        break


Fixed code:
#!/usr/bin/env python

a = []
a.append([int(i) for i in input().split()])
a.append([int(i) for i in input().split()])
a.append([int(i) for i in input().split()])
n = int(input())
c = [[0,0,0],[0,0,0],[0,0,0]]

for i in range(n):
    b = int(input())
    for j in range(3):
        for k in range(3):
            if a[j][k] == b:
                c[j][k] = 1

flag = False

for i in range(3):
    if c[0][i] + c[1][i] + c[2][i] == 3 and flag == False:
        print("Yes")
        flag = True
        break
        
    if c[i][0] + c[i][1] + c[i][2] == 3 and flag == False:
        print("Yes")
        flag = True
        break

    """
    if c[i%3][0] + c[(i+1)%3][1] + c[(i+2)%3][2] == 3 and flag == False:
        print("Yes")
        flag = True
        break
    """
    if c[0][0] + c[1][1] + c[2][2] == 3 and flag == False:
        print("Yes")
        flag = True
        break

    if c[0][2] + c[1][1] + c[2][0] == 3 and flag == False:
        print("Yes")
        flag = True
        break

if flag == False:
    print("No")
Buggy code:
a0,a1,a2=map(int,input().split())
a3,a4,a5=map(int,input().split())
a6,a7,a8=map(int,input().split())
N=int(input())
b=[int(input()) for _ in range(N)]
A=[a0,a1,a2,a3,a4,a5,a6,a7,a8]

for i in range(N):
  for p in range(9):
    if b[i]=A[p]:
      A=0
  
if A[0]==A[1]==A[2]==0 or A[3]==A[4]==A[5]==0 or A[6]==A[7]==A[8]==0 or A[0]==A[3]==A[6]==0 0r A[1]==A[4]==A[7]==0 or A[2]==A[5]==A[8]==0 or A[0]==A[4]==A[8]==0 or A[2]==A[4]==A[6]==0:
  print("Yes")
else:
  print("No")

Fixed code:
a0,a1,a2=map(int,input().split())
a3,a4,a5=map(int,input().split())
a6,a7,a8=map(int,input().split())
N=int(input())
b=[int(input()) for _ in range(N)]
A=[a0,a1,a2,a3,a4,a5,a6,a7,a8]

for i in range(N):
  for p in range(9):
    if b[i]==A[p]:
      A[p]=0
  
if A[0]==A[1]==A[2]==0 or A[3]==A[4]==A[5]==0 or A[6]==A[7]==A[8]==0 or A[0]==A[3]==A[6]==0 or A[1]==A[4]==A[7]==0 or A[2]==A[5]==A[8]==0 or A[0]==A[4]==A[8]==0 or A[2]==A[4]==A[6]==0:
  print("Yes")
else:
  print("No")
Buggy code:

li1 = list(map(int,input().split()))
li1.extend(list(map(int,input().split())))
li1.extend(list(map(int,input().split())))
n = int(input())
for i in range(n):
  p = int(input())
  li1 = [0 if j == p else j for j in li1]
print(li1)
if ( li1[0] + li1[1] + li1[2] ) == 0:
  print('Yes')
elif ( li1[3] + li1[4] + li1[5] ) == 0:
  print('Yes')
elif ( li1[6] + li1[7] + li1[8] ) == 0:
  print('Yes')
elif ( li1[0] + li1[3] + li1[6] ) == 0:
  print('Yes')
elif ( li1[1] + li1[4] + li1[7] ) == 0:
  print('Yes')
elif ( li1[2] + li1[5] + li1[8] ) == 0:
  print('Yes')
elif ( li1[0] + li1[4] + li1[8] ) == 0:
  print('Yes')
elif ( li1[2] + li1[4] + li1[6] ) == 0:
  print('Yes')
else:
  print('No')

Fixed code:
li1 = list(map(int,input().split()))
li1.extend(list(map(int,input().split())))
li1.extend(list(map(int,input().split())))
n = int(input())
for i in range(n):
  p = int(input())
  li1 = [0 if j == p else j for j in li1]
if ( li1[0] + li1[1] + li1[2] ) == 0:
  print('Yes')
elif ( li1[3] + li1[4] + li1[5] ) == 0:
  print('Yes')
elif ( li1[6] + li1[7] + li1[8] ) == 0:
  print('Yes')
elif ( li1[0] + li1[3] + li1[6] ) == 0:
  print('Yes')
elif ( li1[1] + li1[4] + li1[7] ) == 0:
  print('Yes')
elif ( li1[2] + li1[5] + li1[8] ) == 0:
  print('Yes')
elif ( li1[0] + li1[4] + li1[8] ) == 0:
  print('Yes')
elif ( li1[2] + li1[4] + li1[6] ) == 0:
  print('Yes')
else:
  print('No')
Buggy code:
ans="No"
A=3
t=[0]*A
x=[0]*A
y=[0]*A
for i in range(A):
    t[i], x[i], y[i] = map(int, input().split())
#print(x[1])

N=int(input())
S=[]
for _ in range(N):
  S.append(input())
#print(S[0])
S1=[int(s) for  s in S]
for i in range(A):
  if t[i] in S1:
    t[i]=0
  if x[i] in S1:
    x[i]=0
  if y[i] in S1:
    y[i]=0
print(t[0])
if t.count(0)==3:
  ans="Yes"
if x.count(0)==3:
  ans="Yes"
if y.count(0)==3:
  ans="Yes"
if t[0]==0 and x[1]==0 and y[2]==0:
  ans="Yes"
if t[2]==0 and x[1]==0 and y[0]==0:
  ans="Yes"
print(ans)

Fixed code:
ans="No"
A=3
t=[0]*A
x=[0]*A
y=[0]*A
for i in range(A):
    t[i], x[i], y[i] = map(int, input().split())
#print(x[1])

N=int(input())
S=[]
for _ in range(N):
  S.append(input())
#print(S[0])
S1=[int(s) for  s in S]
for i in range(A):
  if t[i] in S1:
    t[i]=0
  if x[i] in S1:
    x[i]=0
  if y[i] in S1:
    y[i]=0
#print(t[0])
if t.count(0)==3:
  ans="Yes"
if x.count(0)==3:
  ans="Yes"
if y.count(0)==3:
  ans="Yes"
if t[0]==0 and x[1]==0 and y[2]==0:
  ans="Yes"
if t[2]==0 and x[1]==0 and y[0]==0:
  ans="Yes"
if t[0]==0 and x[0]==0 and y[0]==0:
  ans="Yes"
if t[1]==0 and x[1]==0 and y[1]==0:
  ans="Yes"
if t[2]==0 and x[2]==0 and y[2]==0:
  ans="Yes"
print(ans)
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 = list(int(input()) for _ in range(n))

for i in b:
    if i in a :
        a[a.index(a)] = "h"

if a[0:3].count("h") == 3 or a[3:6].count("h") == 3 or a[6:9].count("h") == 3:
    print("Yes")
elif a[0] == "h" and a[4] == "h" and a[8] == "h":
    print("Yes")
elif a[2] == "h" and a[4] == "h" and a[6] == "h":
    print("Yes")
elif a[0] == "h" and a[3] == "h" and a[6] == "h":
    print("Yes") 
elif a[1] == "h" and a[4] == "h" and a[7] == "h":
    print("Yes") 
elif a[2] == "h" and a[5] == "h" and a[8] == "h":
    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()))
a = a1+a2+a3
n = int(input())
b = list(int(input()) for _ in range(n))

for i in b:
    if i in a :
        a[a.index(i)] = "h"

if a[0:3].count("h") == 3 or a[3:6].count("h") == 3 or a[6:9].count("h") == 3:
    print("Yes")
elif a[0] == "h" and a[4] == "h" and a[8] == "h":
    print("Yes")
elif a[2] == "h" and a[4] == "h" and a[6] == "h":
    print("Yes")
elif a[0] == "h" and a[3] == "h" and a[6] == "h":
    print("Yes") 
elif a[1] == "h" and a[4] == "h" and a[7] == "h":
    print("Yes") 
elif a[2] == "h" and a[5] == "h" and a[8] == "h":
    print("Yes") 
else:
    print("No")
Buggy code:
a =[ list(map(int,input().split())) for _ in range(3)]
n = int(input())
b = [int(input()) for _ in range(n)]

bingo = []
for i in range(3):
    for j in range(3):
        for k in range(n):
            print(a[i][j])
            if a[i][j] == b[k]:
                a[i][j] = 0

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

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

bingo = []
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
#print(a)
for i in range(3):
    if a[i][0] == 0 and a[i][1] == 0 and a[i][2] == 0 :
        print("Yes")
        exit()
for i in range(3):
    if a[0][i] == 0 and a[1][i] == 0 and a[2][i] == 0 :
        print("Yes")
        exit()
if a[0][0] == 0 and a[1][1] == 0 and a[2][2] == 0:
        print("Yes")
        exit()
if a[0][2] == 0 and a[1][1] == 0 and a[2][0] == 0:
        print("Yes")
        exit()

print("No")
exit()
Buggy code:
a = [list(map(int, input().split())) for i in range(3)]
N = int(input())
b = [int(input()) for i in range(N)]

a = np.array(a)
b = np.array(b)

after = np.zeros((3,3))
for i in range(N):
    after += a == b[i]
    
bool1 = (np.sum(after, axis=0)==3).sum()
bool2 = (np.sum(after, axis=1)==3).sum()
bool3 = (after[0,0]+after[1,1]+after[2,2])==3
bool4 = (after[0,2]+after[1,1]+after[2,0])==3

if bool1+bool2+bool3+bool4>0:
    ans = 'Yes'
else:
    ans = 'No'
    
print(ans)

Fixed code:
import numpy as np

a = [list(map(int, input().split())) for i in range(3)]
N = int(input())
b = [int(input()) for i in range(N)]

a = np.array(a)
b = np.array(b)

after = np.zeros((3,3))
for i in range(N):
    after += a == b[i]
    
bool1 = (np.sum(after, axis=0)==3).sum()
bool2 = (np.sum(after, axis=1)==3).sum()
bool3 = (after[0,0]+after[1,1]+after[2,2])==3
bool4 = (after[0,2]+after[1,1]+after[2,0])==3

if bool1+bool2+bool3+bool4>0:
    ans = 'Yes'
else:
    ans = 'No'
    
print(ans)
Buggy code:
array = [ list(map(int,input().split())) for _ in range(3) ]
number = []
N = int(input())
for _ in range(N):
  number += [ int(input()) ]
for i in range(3):
  for t in range(3):
    if array[i][t] in number:
      array[i][t] = 0
for i in range(1):
  if array[i][0] == array[i+1][0] == array[i+2][0]:
    print('Yes')
    exit()
  elif array[i][1] == array[i+1][1] == array[i+2][1]:
    print('Yes')
    exit()
  elif array[i][2] == array[i+1][2] == array[i+2][2]:
    print('Yes')
    exit()
  elif array[i][0] == array[i][1] == array[i][2] or array[i+1][0] == array[i+1][1] == array[i+1][2] or array[i+2][0] == array[i+2][1] == array[i+2][2]:
    print('Yes')
    exit()
if array[0][0] == array[1][1] == array[2][2] or array[0][2] == array[1][1] == array[2][0]:
  print('Yes')
else:
  print('No')
print(array)


Fixed code:
array = [ list(map(int,input().split())) for _ in range(3) ]
number = []
N = int(input())
for _ in range(N):
  number += [ int(input()) ]
for i in range(3):
  for t in range(3):
    if array[i][t] in number:
      array[i][t] = 0
for i in range(1):
  if array[i][0] == array[i+1][0] == array[i+2][0]:
    print('Yes')
    exit()
  elif array[i][1] == array[i+1][1] == array[i+2][1]:
    print('Yes')
    exit()
  elif array[i][2] == array[i+1][2] == array[i+2][2]:
    print('Yes')
    exit()
  elif array[i][0] == array[i][1] == array[i][2]: 
    print('Yes')
    exit()
  elif array[i+1][0] == array[i+1][1] == array[i+1][2]:
    print('Yes')
    exit()
  elif array[i+2][0] == array[i+2][1] == array[i+2][2]:
    print('Yes')
    exit()
    
if array[0][0] == array[1][1] == array[2][2] or array[0][2] == array[1][1] == array[2][0]:
  print('Yes')
else:
  print('No')
Buggy code:
import numpy as np


A = np.array([list(map(int, input().split())) for _ in range(3)])
n = int(input())
for _ in range(n):
  b = int(input())
  A = np.where(A == b, 0, A)
  
x = np.all(A[[0, 1, 2], [0, 1, 2]] == 0)
y = np.all(A[[0, 1, 2], [2, 1, 0]] == 0)
z = np.any(np.sum(A, axis=0) == 0)
w = np.any(np.sum(A, axis=1) == 0)

print(['Yes', 'No'][!x and !y and !z and !w])

Fixed code:
import numpy as np
 

A = np.array([list(map(int, input().split())) for _ in range(3)])
n = int(input())
for _ in range(n):
  b = int(input())
  A = np.where(A == b, 0, A)
  
x = np.all(A[[0, 1, 2], [0, 1, 2]] == 0)
y = np.all(A[[0, 1, 2], [2, 1, 0]] == 0)
z = np.any(np.sum(A, axis=0) == 0)
w = np.any(np.sum(A, axis=1) == 0)
 
print(['Yes', 'No'][not x and not y and not z and not w])
Buggy code:
def bingo(A, B):
  for i in range(3):
    if A[i][0] == "o" and A[i][1] == "o" and A[i][2] == "o":
      return True
    elif A[0][i] == "o" and A[1][i] == "o" and A[2][i] == "o":
      return True
    
  if A[0][0] == "o" and A[1][1] == "o" and A[2][2] == "o":
    return True
  elif A[0][2] == "o" and A[1][1] == "o" and A[2][0] == "o":
    return True
    
  return False

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

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

if bingo(A, B):
  print("YES")
else:
  print("No")

Fixed code:
def bingo(A, B):
  for i in range(3):
    if A[i][0] == "o" and A[i][1] == "o" and A[i][2] == "o":
      return True
    elif A[0][i] == "o" and A[1][i] == "o" and A[2][i] == "o":
      return True
    
  if A[0][0] == "o" and A[1][1] == "o" and A[2][2] == "o":
    return True
  elif A[0][2] == "o" and A[1][1] == "o" and A[2][0] == "o":
    return True
    
  return False

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

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

if bingo(A, B):
  print("Yes")
else:
  print("No")
Buggy code:
a = [list(map(int, input().split())) for _ in range(3)]
n = int(input())
b_list = [int(input()) for _ in range(n)]

card = [[0] * 3 for _ in range(3)]
for i in range(3):
    for j in range(3):
        if a[i][j] == b_list:
            card[i][j] = 1

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

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

card = [[0] * 3 for _ in range(3)]
for i in range(3):
    for j in range(3):
        if a[i][j] in b_list:
            card[i][j] = 1

for i in range(3):
    if sum(card[i]) == 3 or sum([card[0][i], card[1][i], card[2][i]]) == 3:
        print('Yes')
        exit()
if sum([card[0][0], card[1][1], card[2][2]]) == 3 or sum([card[0][2], card[1][1], card[2][0]]) == 3:
    print('Yes')
    exit()
print('No')
Buggy code:
# -*- coding: utf-8 -*-
# 157b
a = []
b = []
check_list = [False] * 9
for _ in range(3);
  a.extend(list(map(int, input().split())))
n = int(input())
for _ in range(n);
  b.append(int(input()))

for _b in b:
  if _b in a:
    check_list[a.index(_b)] = True

if check_list[0] and check_list[1] and check_list[2]\
  or check_list[3] and check_list[4] and check_list[5]\
  or check_list[6] and check_list[7] and check_list[8]\
  or check_list[0] and check_list[3] and check_list[6]\
  or check_list[1] and check_list[4] and check_list[7]\
  or check_list[2] and check_list[5] and check_list[8]\
  or check_list[0] and check_list[4] and check_list[8]\
  or check_list[2] and check_list[4] and check_list[6]:
  print('Yes')
else:
  print('No')


Fixed code:

# -*- coding: utf-8 -*-
# 157b
a = []
b = []
check_list = [False] * 9
for _ in range(3):
  a.extend(list(map(int, input().split())))
n = int(input())
for _ in range(n):
  b.append(int(input()))

for _b in b:
  if _b in a:
    check_list[a.index(_b)] = True

if check_list[0] and check_list[1] and check_list[2]\
  or check_list[3] and check_list[4] and check_list[5]\
  or check_list[6] and check_list[7] and check_list[8]\
  or check_list[0] and check_list[3] and check_list[6]\
  or check_list[1] and check_list[4] and check_list[7]\
  or check_list[2] and check_list[5] and check_list[8]\
  or check_list[0] and check_list[4] and check_list[8]\
  or check_list[2] and check_list[4] and check_list[6]:
  print('Yes')
else:
  print('No')
Buggy code:
#Bingo
A = [ [] for _ in range(3)]
A[0] = list(map(int,input().split()))
A[1] = list(map(int,input().split()))
A[2] = list(map(int,input().split()))
N = int(input())
B = [int(input()) for _ in range(N)]
L = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]

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

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


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

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

if L[0][0] == L[0][1] == L[0][2] == 1:
    print("Yes")
elif L[1][0] == L[1][1] == L[1][2] == 1:
    print("Yes")
elif L[2][0] == L[2][1] == L[2][2] == 1:
    print("Yes")
elif L[0][0] == L[1][0] == L[2][0] == 1:
    print("Yes")
elif L[0][1] == L[1][1] == L[2][1] == 1:
    print("Yes")
elif L[0][2] == L[1][2] == L[2][2] == 1:
    print("Yes")
elif L[0][0] == L[1][1] == L[2][2] == 1:
    print("Yes")
elif L[0][2] == L[1][1] == L[2][0] == 1:
    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 _ in range(n)]
print(bingo)

for i in range(3):
  for j in range(3):
    if bingo[i][j] in num:
      bingo[i][j] = 0
print(bingo)

for i in range(3):
  if bingo[i].count(0) == 3:
    print("Yes")
    exit()
  elif bingo[0][i] == 0 and bingo[1][i] == 0 and bingo[2][i] == 0:
    print("Yes")
    exit()
  else:
    pass

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


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

for i in range(3):
  for j in range(3):
    if bingo[i][j] in num:
      bingo[i][j] = 0

for i in range(3):
  if bingo[i].count(0) == 3:
    print("Yes")
    exit()
  elif bingo[0][i] == 0 and bingo[1][i] == 0 and bingo[2][i] == 0:
    print("Yes")
    exit()
  else:
    pass

if bingo[0][0] == 0 and bingo[1][1] == 0 and bingo[2][2] ==0:
  print("Yes")
  exit()
elif bingo[0][2] == 0 and bingo[1][1] == 0 and bingo[2][0] == 0:
  print("Yes")
  exit()
else:
  print("No")
Buggy code:
import numpy as np
tmps = []
for i in range(3):
    tmp = list(map(int, input().split(' ')))
    tmps.append(tmp)
bingo = np.array(tmps)
N = int(input())
for i in range(N):
    bingo = np.where(bingo==i, -1, bingo)
c = 2
x1 = 0
x2 = 0
ret = []
for i in range(3):
    row = np.sum(bingo[i, :])
    col = np.sum(bingo[:, i])
    x1 += np.sum(bingo[i, i])
    x2 += np.sum(bingo[i, c-i])
    ret.append(row)
    ret.append(col)
ret.append(x1)
ret.append(x2)
if -3 in ret:
    print('Yes')
else:
    print('No')

Fixed code:
import numpy as np
tmps = []
for i in range(3):
    tmp = list(map(int, input().split(' ')))
    tmps.append(tmp)
bingo = np.array(tmps)
N = int(input())
for i in range(N):
    bingo = np.where(bingo==int(input()), -1, bingo)
c = 2
x1 = 0
x2 = 0
ret = []
for i in range(3):
    row = np.sum(bingo[i, :])
    col = np.sum(bingo[:, i])
    x1 += np.sum(bingo[i, i])
    x2 += np.sum(bingo[i, c-i])
    ret.append(row)
    ret.append(col)
ret.append(x1)
ret.append(x2)
if -3 in ret:
    print('Yes')
else:
    print('No')
Buggy code:
a = [input().split() for a in range(3)]
a1 = [a[0][0],a[0][1],a[0][2]]
a2 = [a[1][0],a[1][1],a[1][2]]
a3 = [a[2][0],a[2][1],a[2][2]]
a4 = [a[0][0],a[1][1],a[2][2]]
a5 = [a[0][2],a[1][1],a[2][0]]
a6 = [a[0][0],a[1][0],a[2][0]]
a7 = [a[1][0],a[1][1],a[2][1]]
a8 = [a[2][0],a[2][1],a[2][2]]
n = int(input())
B = [int(input()) for i in range(n)]
if set(a1) <= B or set(a2) <= B or set(a3) <= B or set(a4) <= B or set(a5) <= B or set(a6) <= B or set(a7) <= B or set(a8) <= B:
    print('Yes')
else:
    print('No')

Fixed code:
a = [input().split() for a in range(3)]
a1 = [a[0][0],a[0][1],a[0][2]]
a2 = [a[1][0],a[1][1],a[1][2]]
a3 = [a[2][0],a[2][1],a[2][2]]
a4 = [a[0][0],a[1][1],a[2][2]]
a5 = [a[0][2],a[1][1],a[2][0]]
a6 = [a[0][0],a[1][0],a[2][0]]
a7 = [a[0][1],a[1][1],a[2][1]]
a8 = [a[0][2],a[1][2],a[2][2]]
n = int(input())
B = [input() for i in range(n)]
if set(a1) <= set(B) or set(a2) <= set(B) or set(a3) <= set(B) or set(a4) <= set(B) or set(a5) <= set(B) or set(a6) <= set(B) or set(a7) <= set(B) or set(a8) <= set(B):
    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()))
a4 = set()
a5 = set()
a4.update({a1[0],a2[1],a3[2]})
a5.update({a1[2],a2[1],a3[0]})
print(a4)
print(a5)
n = int(input())
B =set()
for i in range(n):
    b = int(input())
    B.add(b)
if set(a1) <= B or set(a2) <= B or set(a3) <= B or a4 <= B or a5 <= 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()))
a4 = set()
a5 = set()
a6 = set()
a7 = set()
a8 = set()
a4.update({a1[0],a2[1],a3[2]})
a5.update({a1[2],a2[1],a3[0]})
a6.update({a1[0],a2[0],a3[0]})
a7.update({a1[1],a2[1],a3[1]})
a8.update({a1[2],a2[2],a3[2]})
n = int(input())
B =set()
for i in range(n):
    b = int(input())
    B.add(b)
if set(a1) <= B or set(a2) <= B or set(a3) <= B or a4 <= B or a5 <= B or a6 <= B or a7 <= B or a8 <= B:
    print('Yes')
else:
    print('No')
Buggy code:
import sys
input = sys.stdin.readline


def main():
    A = [list(map(int, input().split())) for _ in range(3)]
    print(A[0])
    a = [[False] * 3 for _ in range(3)]
    n = int(input())
    for _ in range(n):
        b = int(input())
        for i in range(3):
            for j in range(3):
                if A[i][j] == b:
                    a[i][j] = True
    for i in range(3):
        if all(a[i]):
            print("Yes")
            return
    for j in range(3):
        if all([a[0][j], a[1][j], a[2][j]]):
            print("Yes")
            return
    if a[0][0] and a[1][1] and a[2][2]:
        print("Yes")
        return
    if a[0][2] and a[1][1] and a[2][0]:
        print("Yes")
        return
    print("No")


if __name__ == "__main__":
    main()


Fixed code:
import sys
input = sys.stdin.readline


def main():
    A = [list(map(int, input().split())) for _ in range(3)]
    a = [[False] * 3 for _ in range(3)]
    n = int(input())
    for _ in range(n):
        b = int(input())
        for i in range(3):
            for j in range(3):
                if A[i][j] == b:
                    a[i][j] = True
    for i in range(3):
        if all(a[i]):
            print("Yes")
            return
    for j in range(3):
        if all([a[0][j], a[1][j], a[2][j]]):
            print("Yes")
            return
    if a[0][0] and a[1][1] and a[2][2]:
        print("Yes")
        return
    if a[0][2] and a[1][1] and a[2][0]:
        print("Yes")
        return
    print("No")


if __name__ == "__main__":
    main()