qyliang/CodeNanoFix huggingface dataset:
Buggy code:
import itertools
l1=list(map(int,input().split(" ")))
l2=list(map(int,input().split(" ")))
l3=list(map(int,input().split(" ")))
b_st=[list(sorted(l1))]
b_st.append(list(sorted(l2)))
b_st.append(list(sorted(l3)))

b_st.append(list(sorted([l1[0],l2[0],l3[0]])))
b_st.append(list(sorted([l1[1],l2[1],l3[1]])))
b_st.append(list(sorted([l1[2],l2[2],l3[2]])))
b_st.append(list(sorted([l1[0],l2[1],l3[2]])))
b_st.append(list(sorted([l1[2],l2[1],l3[0]])))
con=int(input())
#print(b_st)
f=0
list1=[int(input())for n in range(0,con)]
list1=list(sorted(list1))
l2=[[a,b,c] for a,b,c in list(list(itertools.combinations(list1,3)))]
#print(l2)
#print(b_st)
for sw in b_st:
    for lw2 in l2:
        #print(sw)
        #print(lw2)
        if sw==lw2:
            print("Yes")
            f=1
            break
if f==0:
    print("No")

Fixed code:
import itertools
l1=list(map(int,input().split(" ")))
l2=list(map(int,input().split(" ")))
l3=list(map(int,input().split(" ")))
b_st=[list(sorted(l1))]
b_st.append(list(sorted(l2)))
b_st.append(list(sorted(l3)))

b_st.append(list(sorted([l1[0],l2[0],l3[0]])))
b_st.append(list(sorted([l1[1],l2[1],l3[1]])))
b_st.append(list(sorted([l1[2],l2[2],l3[2]])))
b_st.append(list(sorted([l1[0],l2[1],l3[2]])))
b_st.append(list(sorted([l1[2],l2[1],l3[0]])))
con=int(input())
#print(b_st)
f=0

if con==1:
    a=int(input())
    l2=[[a,a,a]]
elif con==2:
    list1=[int(input())for n in range(0,con)]
    l2=list[list[itertools.combinations_with_replacement(list1, 3)]]
else:
    list1=[int(input())for n in range(0,con)]
    list1=list(sorted(list1))
    l2=[[a,b,c] for a,b,c in list(list(itertools.combinations(list1,3)))]
#print(l2)
#print(b_st)
for sw in b_st:
    for lw2 in l2:
        #print(sw)
        #print(lw2)
        if sw==lw2:
            print("Yes")
            f=1
            break
    if f==1:
        break
if f==0:
    print("No")
Buggy code:
l = []
flag = 0
for i in range(3):
  for j in input().split():
    l.append(j)
n = int(input())
for i in range(n):
  a = input()
  if a in l:
    l[l.index(a)] = 0
if l[0:3] == 0 or l[3:6] == 0 or l[6:9] == 0:
  flag = 1
if l[0::3] == 0 or l[1::3] == 0 or l[2::3] == 0:
  flag = 1
if l[0::4] == 0 or l[2::2] == 0:
  flag = 1
if flag:
  print("Yes")
else:
  print("No")

Fixed code:
l = []
flag = 0
for i in range(3):
  for j in input().split():
    l.append(j)
n = int(input())
for i in range(n):
  a = input()
  if a in l:
    l[l.index(a)] = 0
if not any(l[0:3])  or not any(l[3:6]) or not any(l[6:9]):
  flag = 1
if not any(l[0::3]) or not any(l[1::3]) or not any(l[2::3]):
  flag = 1
if not any(l[0::4]) or not any(l[2:7:2]):
  flag = 1
if flag:
  print("Yes")
else:
  print("No")
Buggy code:
bingo = [[],[],[]]
 
for i in range(3):
  a, b, c = map(int,input().split())
  bingo[i].append(a)
  bingo[i].append(b)
  bingo[i].append(c)
  
N = int(input())
  
for i in range(N):
  S = int(input())
  for j in range(3):
    if S in bingo[j]:
      for k in range(3):
        if S == bingo[j][k]:
          bingo[j][k] = 'ok'
          
ANS = 0
 
for i in range(3):
  for j in range(3):
    if bingo[i][j] == 'ok':
      ANS += 1
      if ANS == 3:
        print("Yes")
  ANS = 0
 
for i in range(3):
  for j in range(3):
    if bingo[j][i] == 'ok':
      ANS += 1
      if ANS == 3:
        print("Yes")
  ANS = 0
 
if bingo[1][1] == 'ok':
  if bingo[0][0] == 'ok' and bingo[2][2] == 'ok':
    print("Yse")
  elif bingo[0][2] == 'ok' and bingo[2][0] == 'ok':
    print("Yse")
  else:
    print("No")
 

Fixed code:
import sys
bingo = [[],[],[]]
 
for i in range(3):
  a, b, c = map(int,input().split())
  bingo[i].append(a)
  bingo[i].append(b)
  bingo[i].append(c)
  
N = int(input())
  
for i in range(N):
  S = int(input())
  for j in range(3):
    if S in bingo[j]:
      for k in range(3):
        if S == bingo[j][k]:
          bingo[j][k] = 'ok'
          
ANS = 0
 
for i in range(3):
  for j in range(3):
    if bingo[i][j] == 'ok':
      ANS += 1
      if ANS == 3:
        print("Yes")
        sys.exit()
  ANS = 0
 
for i in range(3):
  for j in range(3):
    if bingo[j][i] == 'ok':
      ANS += 1
      if ANS == 3:
        print("Yes")
        sys.exit()
  ANS = 0
 
if bingo[1][1] == 'ok':
  if bingo[0][0] == 'ok' and bingo[2][2] == 'ok':
    print("Yes")
    sys.exit()
  elif bingo[0][2] == 'ok' and bingo[2][0] == 'ok':
    print("Yes")
    sys.exit()
  else:
    print("No")
    sys.exit()
print("No")
Buggy code:
import numpy as np

A = [[0] * 3 for i 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 = [0] * N
for i in range(N):
    b[i] = int(input())
print(b)

if ((A[0][0] in b) & (A[0][1] in b) & (A[0][2] in b)):
    print('Yes')
elif ((A[1][0] in b) & (A[1][1] in b) & (A[1][2] in b)):
    print('Yes')
elif ((A[2][0] in b) & (A[2][1] in b) & (A[2][2] in b)):
    print('Yes')
elif ((A[0][0] in b) & (A[1][0] in b) & (A[2][0] in b)):
    print('Yes')
elif ((A[0][1] in b) & (A[1][1] in b) & (A[2][1] in b)):
    print('Yes')
elif ((A[0][2] in b) & (A[1][2] in b) & (A[2][2] in b)):
    print('Yes')
elif ((A[0][0] in b) & (A[1][1] in b) & (A[2][2] in b)):
    print('Yes')
elif ((A[0][2] in b) & (A[1][1] in b) & (A[2][0] in b)):
    print('Yes')
else:
    print('No')

Fixed code:
import numpy as np

A = [[0] * 3 for i 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 = [0] * N
for i in range(N):
    b[i] = int(input())

if ((A[0][0] in b) & (A[0][1] in b) & (A[0][2] in b)):
    print('Yes')
elif ((A[1][0] in b) & (A[1][1] in b) & (A[1][2] in b)):
    print('Yes')
elif ((A[2][0] in b) & (A[2][1] in b) & (A[2][2] in b)):
    print('Yes')
elif ((A[0][0] in b) & (A[1][0] in b) & (A[2][0] in b)):
    print('Yes')
elif ((A[0][1] in b) & (A[1][1] in b) & (A[2][1] in b)):
    print('Yes')
elif ((A[0][2] in b) & (A[1][2] in b) & (A[2][2] in b)):
    print('Yes')
elif ((A[0][0] in b) & (A[1][1] in b) & (A[2][2] in b)):
    print('Yes')
elif ((A[0][2] in b) & (A[1][1] in b) & (A[2][0] in b)):
    print('Yes')
else:
    print('No')
Buggy code:
A = [list(map(int,input().split())) for i in range(3)]

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

for i in b:
  for j in range(3):
    if i in A[j]:
      A[j][A[j].index(i)] = 0
else:
  for i in range(3):
    if (A[0][j] + A[1][j] + A[2][j] == 0) or (A[j][0] + A[j][1] + A[j][2] == 0):
      print('Yes')
  else:
    if (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:
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 b:
  for j in range(3):
    if i in A[j]:
      A[j][A[j].index(i)] = 0
else:
  for i in range(3):
    if (A[0][i] + A[1][i] + A[2][i] == 0) or (A[i][0] + A[i][1] + A[i][2] == 0):
      print('Yes')
      break
  else:
    if (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:
a = [list(map(int, input().split())) for _ in range(3)]
is_bingo = [[False]*3 for _ in range(3)]
n = int(input())
for _ in range(n):
    b = int(input())
    for i, ai in enumerate(a):
        for j, aii in enumerate(ai):
            if aii == b:
                is_bingo[i][j] = True
is_bingo_flat = [j for i in is_bingo for j in i]
for i in range(3):
    if all(is_bingo[i]) or all(list(zip(*is_bingo))[i]) or is_bingo_flat[i::3]:
        print("Yes")
        break
else:
    print("No")

        

Fixed code:
a = [list(map(int, input().split())) for _ in range(3)]
is_bingo = [[False]*3 for _ in range(3)]
n = int(input())
for _ in range(n):
    b = int(input())
    for i, ai in enumerate(a):
        for j, aii in enumerate(ai):
            if aii == b:
                is_bingo[i][j] = True
is_bingo_flat = [j for i in is_bingo for j in i]
for i in range(3):
    if all(is_bingo[i]) or all(list(zip(*is_bingo))[i]):
        print("Yes")
        break
else:
    if all(is_bingo_flat[::4]) or all(is_bingo_flat[2:7:2]):
        print("Yes")
    else:
        print("No")
Buggy code:
l=[list(map(int,input().split())) for i in range(3)]
l=sum(l,[])
n=int(input())
li=set([input() for ini in range(n)])
d=[0 for i in range(9)]
for g in range(9):
  if l[g] in li:d[g]=1
for a,s,x in [(0,1,2),(3,4,5),(6,7,8),(0,4,8),(2,4,6),(0,3,6),(1,4,7),(2,5,8)]:
  if d[a]==d[x]==d[s]==1:
    print("Yes");exit()
print("No")

Fixed code:
l=[list(map(int,input().split())) for i in range(3)]
l=sum(l,[])
n=int(input())
li=set([int(input()) for ini in range(n)])
d=[0 for i in range(9)]
for g in range(9):
  if l[g] in li:d[g]=1

for a,s,x in [(0,1,2),(3,4,5),(6,7,8),(0,4,8),(2,4,6),(0,3,6),(1,4,7),(2,5,8)]:
  if d[a]==d[x]==d[s]==1:
    print("Yes");exit()
print("No")
Buggy code:
a = [list(map(int, input().split())) 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] = 0

ok = True

for i in range(3):
    count = 0
    for j in range(3):
        count += a[i][j]
        if count != 0:
            ok = False
for i in range(3):
    count = 0
    for j in range(3):
        count += a[j][i]
        if count != 0:
            ok = False
count = 0
for i in range(3):
    count += a[i][i]
    if count != 0:
        ok = False
count = 0
for i in range(3):
    count += a[2-i][i]
    if count != 0:
        ok = False

print("Yes" if ok else "No")


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

n = int(input())

bingo = [[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:
                bingo[i][j] = 1

ok = False

for i in range(3):
    count = 0
    for j in range(3):
        count += bingo[i][j]
    if count == 3:
        ok = True
for i in range(3):
    count = 0
    for j in range(3):
        count += bingo[j][i]
    if count == 3:
        ok = True
count = 0
for i in range(3):
    count += bingo[i][i]
    if count == 3:
        ok = True
count = 0
for i in range(3):
    count += bingo[2-i][i]
    if count == 3:
        ok = True

print("Yes" if ok else "No")
Buggy code:
a = [list(map(int,input().split())) for i in range(3)]
n = int(input())
b = [int(input()) for i in range(n)]
for number in b:
    if b in a:
        a[a.index(b)] = 0
if a[0][0] == a[1][1] == a[2][2]:
    print('Yes')
else:
    for i in range(3):
        if a[i][0] == a[i][1] == a[i][2]:
            print('Yes')
            break
        elif a[0][i] == a[1][i] == a[2][i]:
            print('Yes')
            break
    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 number in b:
    for i in range(3):
        if number in a[i]:
            a[i][a[i].index(number)] = 0
if a[0][0] == a[1][1] == a[2][2] == 0 or a[2][0] == a[1][1] == a[0][2] == 0:
    print('Yes')
else:
    for i in range(3):
        if a[i][0] == a[i][1] == a[i][2] == 0:
            print('Yes')
            break
        elif a[0][i] == a[1][i] == a[2][i] == 0:
            print('Yes')
            break
    else:
        print('No')
Buggy code:
import sys
A = [list(map(int,input().split())) for i in range(3)]
N = int(input())
b = [int(input()) for i in range(N)]
ans_flag = True
ans = [[False, False, False], [False, False, False], [False, False, False]]

for i in range(3):
    for j in range(3):
        if A[i][j] in b:
            ans[i][j] = True

print(ans)

for i in range(3):
    if ans[0][i] and ans[1][i] and ans[2][i]:
        print('Yes')
        sys.exit()
    if ans[i][0] and ans[i][1] and ans[i][2]:
        print('Yes')
        sys.exit()
    if not ans[i][i]:
        ans_flag = False

if ans_flag:
    print('Yes')
else:
    print('No')

Fixed code:
import sys
A = [list(map(int,input().split())) for i in range(3)]
N = int(input())
b = [int(input()) for i in range(N)]
ans_flag = True
ans_flag2 = True
ans = [[False, False, False], [False, False, False], [False, False, False]]

for i in range(3):
    for j in range(3):
        if A[i][j] in b:
            ans[i][j] = True

for i in range(3):
    if ans[0][i] and ans[1][i] and ans[2][i]:
        print('Yes')
        sys.exit()
    if ans[i][0] and ans[i][1] and ans[i][2]:
        print('Yes')
        sys.exit()
    if not ans[i][i]:
        ans_flag = False
    if not ans[i][2-i]:
        ans_flag2 = False

if ans_flag or ans_flag2:
    print('Yes')
else:
    print('No')
Buggy code:
A11, A12, A13 = input().split(' ')
A21, A22, A23 = input().split(' ')
A31, A32, A33 = input().split(' ')
N = int(input())
b = []
for i in range(N):
  b = input()
if A11 and A12 and A13 in b:
  print('Yes')
elif A21 and A22 and A23 in b:
  print('Yes')
elif A31 and A32 and A33 in b:
  print('Yes')
elif A11 and A21 and A31 in b:
  print('Yes')
elif A12 and A22 and A32 in b:
  print('Yes')
elif A13 and A23 and A33 in b:
  print('Yes')
elif A11 and A22 and A33 in b:
  print('Yes')
elif A13 and A22 and A31 in b:
  print('Yes')
else:
  print('No')

Fixed code:
A11, A12, A13 = input().split(' ')
A21, A22, A23 = input().split(' ')
A31, A32, A33 = input().split(' ')
A11 = int(A11)
A12 = int(A12)
A13 = int(A13)
A21 = int(A21)
A22 = int(A22)
A23 = int(A23)
A31 = int(A31)
A32 = int(A32)
A33 = int(A33)
N = int(input())
b = []
for i in range(N):
  bi = int(input())
  b.append(bi)
if A11 in b and A12 in b and A13 in b:
  print('Yes')
elif A21 in b and A22 in b and A23 in b:
  print('Yes')
elif A31 in b and A32 in b and A33 in b:
  print('Yes')
elif A11 in b and A21 in b and A31 in b:
  print('Yes')
elif A12 in b and A22 in b and A32 in b:
  print('Yes')
elif A13 in b and A23 in b and A33 in b:
  print('Yes')
elif A11 in b and A22 in b and A33 in b:
  print('Yes')
elif A13 in b and A22 in b  and A31 in b:
  print('Yes')
else:
  print('No')
Buggy code:
def main():
    import numpy as np

    card = np.array([list(map(int, input().split())) for _ in range(3)])
    n = int(input())
    for _ in range(n):
        b = int(input())
        card = np.where(card == b, 0, card)

    is_bingo = False
    is_bingo = np.sum(card, axis=0).min() == 0
    is_bingo = np.sum(card, axis=1).min() == 0
    is_bingo = np.sum(np.diag(card)) == 0
    is_bingo = np.sum(np.diag(np.fliplr(card))) == 0

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


if __name__ == '__main__':
    main()


Fixed code:
def main():
    import numpy as np

    card = np.array([list(map(int, input().split())) for _ in range(3)])
    n = int(input())
    for _ in range(n):
        b = int(input())
        card = np.where(card == b, 0, card)

    is_bingo = False
    is_row_bingo = np.sum(card, axis=0).min() == 0
    is_column_bingo = np.sum(card, axis=1).min() == 0
    is_diag_bingo1 = np.sum(np.diag(card)) == 0
    is_diag_bingo2 = np.sum(np.diag(np.fliplr(card))) == 0

    print('Yes' if is_row_bingo or is_column_bingo or is_diag_bingo1 or is_diag_bingo2 else 'No')


if __name__ == '__main__':
    main()
Buggy code:
#!/usr/bin/env python3
import sys
#input = sys.stdin.buffer.readline

def inn(func=int):
    return list(map(func,input().split()))

def ins():
    return input().split()

a0 = inn()
a1 = inn()
a2 = inn()
a = a0+a1+a2
n = int(input())
ban = [0,0,0,0,0,0,0,0,0]
for i in range(n):
    b = int(input())
    for j in range(9):
        if b == a[j]:
            ban[j] = 1

for i in [0,3,6]:
    tate = ban[i]+ban[i+3]+ban[i+6]
    yoko = ban[i]+ban[i+1]+ban[i+2]
    if tate == 3 or yoko == 3:
        print("Yes")
        exit()
if (ban[0]+ban[4]+ban[8]) == 3 or (ban[2]+ban[4]+ban[6]) == 3:
    print("Yes")
    exit()
print("No")

Fixed code:
#!/usr/bin/env python3
import sys
#input = sys.stdin.buffer.readline

def inn(func=int):
    return list(map(func,input().split()))

def ins():
    return input().split()

a0 = inn()
a1 = inn()
a2 = inn()
a = a0+a1+a2
n = int(input())
ban = [0,0,0,0,0,0,0,0,0]
for i in range(n):
    b = int(input())
    for j in range(9):
        if b == a[j]:
            ban[j] = 1


for i in [0,1,2]:
    t = ban[i]+ban[i+3]+ban[i+6]
    if t == 3:
        print("Yes")
        exit()
for i in [0,3,6]:
    t = ban[i]+ban[i+1]+ban[i+2]
    if t == 3:
        print("Yes")
        exit()
if (ban[0]+ban[4]+ban[8]) == 3 or (ban[2]+ban[4]+ban[6]) == 3:
    print("Yes")
    exit()
print("No")
Buggy code:
a=[[0]*3 for i in range(3)]
b=[]
for i in range(3):
  x=input().split()
  a[i][0]=x[0]
  a[i][1]=x[1]
  a[i][2]=x[2]
n=int(input())
for i in range(n):
  b.append(input())
for i in range(n):
  for j in range(9):
    if b[i]==a[j//3][j%3]:
      a[j//3][j%3]='X'
jud=[0,0,0,0]
z=0
res=0
for i in range(3):
  for j in range(2):
    if a[i][j]==a[i][j+1]:
      jud[0]+=1
    if a[j][i]==a[j+1][i]:
      jud[1]+=1
  if max(jud)>1:
    res-=1
  else:
    jud[0]=0
    jud[1]=0
for j in range(2):
  if a[j][j]==a[j+1][j+1]:
    jud[2]+=1
  if a[j][2-j]==a[j+1][2-j-1]:
    jud[3]+=1
  if max(jud)>1:
    res-=1
  else:
    jud[3]=0
    jud[2]=0
if res<0:
  print('Yes')
else:
  print('No')

Fixed code:
a=[[0]*3 for i in range(3)]
b=[]
for i in range(3):
  x=input().split()
  a[i][0]=x[0]
  a[i][1]=x[1]
  a[i][2]=x[2]
n=int(input())
for i in range(n):
  b.append(input())
for i in range(n):
  for j in range(9):
    if b[i]==a[j//3][j%3]:
      a[j//3][j%3]='X'
jud=[0,0,0,0]
z=0
res=0
for i in range(3):
  for j in range(2):
    if a[i][j]==a[i][j+1]:
      jud[0]+=1
    if a[j][i]==a[j+1][i]:
      jud[1]+=1
  if max(jud)>1:
    res-=1
  else:
    jud[0]=0
    jud[1]=0
for j in range(2):
  if a[j][j]==a[j+1][j+1]:
    jud[2]+=1
  if a[j][2-j]==a[j+1][2-j-1]:
    jud[3]+=1
if max(jud)>1:
  res-=1
if res<0:
  print('Yes')
else:
  print('No')
Buggy code:
aList = []
for i in range(3):
  aList.append(list(map(int, input().split())))
n = int(input())
bList = []
for i in range(n):
  bList.append(int(input()))

aListCheck = []
for i in range(3):
  aListCheckRow = []
  for j in range(3):
    aListCheckRow.append(aList[i][j] in bList)
  aListCheck.append(aListCheckRow)

for i in range(3):
  if aListCheck[i][0] and aListCheck[i][1] and aListCheck[i][2]:
    print('YES')
    exit()
  if aListCheck[0][i] and aListCheck[1][i] and aListCheck[2][i]:
    print('YES')
    exit()
if aListCheck[0][0] and aListCheck[1][1] and aListCheck[2][2]:
  print('YES')
  exit()
if aListCheck[0][2] and aListCheck[1][1] and aListCheck[2][0]:
  print('YES')
  exit()

print('No')

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

aListCheck = []
for i in range(3):
  aListCheckRow = []
  for j in range(3):
    aListCheckRow.append(aList[i][j] in bList)
  aListCheck.append(aListCheckRow)

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

print('No')
Buggy code:
import sys

a = [[0] * 3 for _ in range(3)]
a[0] = list(map(int, sys.stdin.readline().strip().split()))
a[1] = list(map(int, sys.stdin.readline().strip().split()))
a[2] = list(map(int, sys.stdin.readline().strip().split()))
n = int(sys.stdin.readline().strip())
b = [0] * n
for i in range(n):
    b = int(sys.stdin.readline().strip())

    for row in range(3):
        for col in range(3):
            if a[row][col] == b:
                a[row][col] = 0


def is_bingo():
    # horizontal
    for r in range(3):
        if a[r][0] + a[r][1] + a[r][2] == 0:
            return True
    # vertical
    for c in range(3):
        if a[0][c] + a[1][c] + a[2][c] + 0:
            return True

    if a[0][0] + a[1][1] + a[2][2] == 0:
        return True
    if a[2][0] + a[1][1] + a[0][2] == 0:
        return True

    return False


if is_bingo():
    print('Yes')
else:
    print('No')




Fixed code:
import sys

a = [[0] * 3 for _ in range(3)]
a[0] = list(map(int, sys.stdin.readline().strip().split()))
a[1] = list(map(int, sys.stdin.readline().strip().split()))
a[2] = list(map(int, sys.stdin.readline().strip().split()))
n = int(sys.stdin.readline().strip())
b = [0] * n
for i in range(n):
    b = int(sys.stdin.readline().strip())

    for row in range(3):
        for col in range(3):
            if a[row][col] == b:
                a[row][col] = 0


def is_bingo():
    # horizontal
    for r in range(3):
        if a[r][0] + a[r][1] + a[r][2] == 0:
            return True
    # vertical
    for c in range(3):
        if a[0][c] + a[1][c] + a[2][c] == 0:
            return True

    if a[0][0] + a[1][1] + a[2][2] == 0:
        return True
    if a[2][0] + a[1][1] + a[0][2] == 0:
        return True

    return False


if is_bingo():
    print('Yes')
else:
    print('No')
Buggy code:
# coding: utf-8
a = [list(map(int, input().split())) for _ in range(3)]
n = int(input())
b = list([int(input()) for _ in range(n)])
ans = "No"

# ana check
for bi in b:
    print(bi)
    for i in range(3):
        for j in range(3):
            if a[i][j] == bi:
                a[i][j] = "hole"

# tate bingo
for j in range(3):
    if a[0][j] == "hole":
        if a[1][j] == "hole" and a[2][j] == "hole":
            ans = "Yes"

# yoko bingo
for i in range(3):
    if a[i][0] == "hole":
        if a[i][1] == "hole" and a[i][2] == "hole":
            ans = "Yes"

# naname bingo
if a[0][0] == "hole" and a[1][1] == "hole" and a[1][1] == "hole":
    ans = "Yes"
if a[0][2] == "hole" and a[1][1] == "hole" and a[2][0] == "hole":
    ans = "Yes"

print(ans)


Fixed code:
# coding: utf-8
a = [list(map(int, input().split())) for _ in range(3)]
n = int(input())
b = list([int(input()) for _ in range(n)])
ans = "No"

# ana check
for bi in b:
    for i in range(3):
        for j in range(3):
            if a[i][j] == bi:
                a[i][j] = "hole"

# tate bingo
for j in range(3):
    if a[0][j] == "hole":
        if a[1][j] == "hole" and a[2][j] == "hole":
            ans = "Yes"

# yoko bingo
for i in range(3):
    if a[i][0] == "hole":
        if a[i][1] == "hole" and a[i][2] == "hole":
            ans = "Yes"

# naname bingo
if a[0][0] == "hole" and a[1][1] == "hole" and a[2][2] == "hole":
    ans = "Yes"
if a[0][2] == "hole" and a[1][1] == "hole" and a[2][0] == "hole":
    ans = "Yes"

print(ans)
Buggy code:

def check(grid):
	bingo=False
	#row
	for i in range(3):
		count=0
		for j in range(3):
			if grid[i][j]==1:
				count+=1
	if count==3:
		print(1)
		bingo=True
	#col
	count=0
	for i in range(3):
		for j in range(3):
			if grid[j][i]==1:
				count+=1
	if count==3:
		print(2)
		bingo=True
	#left diag
	count=0
	for i in range(3):
		if grid[i][i]==1:
			count+=1
	if count==3:
		print(3)
		bingo=True
	#right diag
	count=0
	for i in range(3):
		if grid[i][2-i]==1:
			count+=1
	if count==3:
		print(4)
		bingo=True
		
	return bingo
		
pos={}
for i in range(3):
	temp=list(map(int,input().split(' ')))
	for j,t in enumerate(temp):
		pos[t]=[i,j]
grid=[[0 for i in range(3)] for j in range(3)]

n=int(input())
for i in range(n):
	t=int(input())
	if t in pos.keys():
		r,c=pos[t]
		grid[r][c]=1
bingo=check(grid)

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

Fixed code:

def check(grid):
	bingo=False
	#row
	for i in range(3):
		count=0
		for j in range(3):
			if grid[i][j]==1:
				count+=1
		if count==3:
			bingo=True
	#col
	for i in range(3):
		count=0
		for j in range(3):
			if grid[j][i]==1:
				count+=1
		if count==3:
			bingo=True
	#left diag
	count=0
	for i in range(3):
		if grid[i][i]==1:
			count+=1
	if count==3:
		bingo=True
	#right diag
	count=0
	for i in range(3):
		if grid[i][2-i]==1:
			count+=1
	if count==3:
		bingo=True
		
	return bingo
		
pos={}
for i in range(3):
	temp=list(map(int,input().split(' ')))
	for j,t in enumerate(temp):
		pos[t]=[i,j]
grid=[[0 for i in range(3)] for j in range(3)]

n=int(input())
for i in range(n):
	t=int(input())
	if t in pos.keys():
		r,c=pos[t]
		grid[r][c]=1
bingo=check(grid)

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