Buggy python submission (verdict: Runtime Error):
#ABC157.B
A = list(input().split()for l in range(3))
N = int(input())
b = [int(input())for _ in range(N)]
for i in b:
    if i in A:
        A[A.index(i)]=0
if A[0]==0 and A[1]==0 and A[2]==0:
    print('Yes')
elif A[3]==0 and A[4]==0 and A[5]==0:
    print('Yes')
elif A[6]==0 and A[7]==0 and A[8]==0:
    print('Yes')

elif A[0]==0 and A[3]==0 and A[6]==0:
    print('Yes')
elif A[1]==0 and A[4]==0 and A[7]==0:
    print('Yes')
elif A[2]==0 and A[5]==0 and A[8]==0:
    print('Yes')

elif A[0]==0 and A[4]==0 and A[8]==0:
    print('Yes')
elif A[2]==0 and A[4]==0 and A[6]==0:
    print('Yes')
else:
    print('No')

Fixed submission:
#ABC157.B
A1 = list(map(int,input().split()))
A2 = list(map(int,input().split()))
A3 = list(map(int,input().split()))
N = int(input())
b = [int(input())for _ in range(N)]
if (A1[0] in b)and (A1[1]in b)and (A1[2] in b):
    print('Yes')
elif (A2[0]in b)and(A2[1] in b)and(A2[2]in b):
    print('Yes')
elif (A3[0]in b)and(A3[1]in b)and (A3[2]in b):
    print('Yes')
elif (A1[0]in b)and(A2[0]in b)and(A3[0]in b):
    print('Yes')
elif (A1[1]in b)and (A2[1]in b)and(A3[1]in b):
    print('Yes')
elif (A1[2] in b)and (A2[2]in b)and(A3[2]in b):
    print('Yes')
elif (A1[0]in b)and (A2[1]in b)and(A3[2]in b):
    print('Yes')
elif (A1[2]in b)and (A2[1]in b)and(A3[0]in b):
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
#ABC157.B
A = list(map(int,input().split()))
N = int(input())
b = [int(input())for _ in range(N)]
for i in b:
    if i in A:
        A[A.index(i)]=0
if A[0]==0 and A[1]==0 and A[2]==0:
    print('Yes')
elif A[3]==0 and A[4]==0 and A[5]==0:
    print('Yes')
elif A[6]==0 and A[7]==0 and A[8]==0:
    print('Yes')

elif A[0]==0 and A[3]==0 and A[6]==0:
    print('Yes')
elif A[1]==0 and A[4]==0 and A[7]==0:
    print('Yes')
elif A[2]==0 and A[5]==0 and A[8]==0:
    print('Yes')

elif A[0]==0 and A[4]==0 and A[8]==0:
    print('Yes')
elif A[2]==0 and A[4]==0 and A[6]==0:
    print('Yes')
else:
    print('No')

Fixed submission:
#ABC157.B
A1 = list(map(int,input().split()))
A2 = list(map(int,input().split()))
A3 = list(map(int,input().split()))
N = int(input())
b = [int(input())for _ in range(N)]
if (A1[0] in b)and (A1[1]in b)and (A1[2] in b):
    print('Yes')
elif (A2[0]in b)and(A2[1] in b)and(A2[2]in b):
    print('Yes')
elif (A3[0]in b)and(A3[1]in b)and (A3[2]in b):
    print('Yes')
elif (A1[0]in b)and(A2[0]in b)and(A3[0]in b):
    print('Yes')
elif (A1[1]in b)and (A2[1]in b)and(A3[1]in b):
    print('Yes')
elif (A1[2] in b)and (A2[2]in b)and(A3[2]in b):
    print('Yes')
elif (A1[0]in b)and (A2[1]in b)and(A3[2]in b):
    print('Yes')
elif (A1[2]in b)and (A2[1]in b)and(A3[0]in b):
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
#ABC157.B
A = list(map(int,input().split()))
N = int(input())
b = list(map(int,input().split()))

for i in b:
    if i in A:
        A[A.index(i)]=0
if A[0]==0 and A[1]==0 and A[2]==0:
    print('Yes')
elif A[3]==0 and A[4]==0 and A[5]==0:
    print('Yes')
elif A[6]==0 and A[7]==0 and A[8]==0:
    print('Yes')

elif A[0]==0 and A[3]==0 and A[6]==0:
    print('Yes')
elif A[1]==0 and A[4]==0 and A[7]==0:
    print('Yes')
elif A[2]==0 and A[5]==0 and A[8]==0:
    print('Yes')

elif A[0]==0 and A[4]==0 and A[8]==0:
    print('Yes')
elif A[2]==0 and A[4]==0 and A[6]==0:
    print('Yes')
else:
    print('No')

Fixed submission:
#ABC157.B
A1 = list(map(int,input().split()))
A2 = list(map(int,input().split()))
A3 = list(map(int,input().split()))
N = int(input())
b = [int(input())for _ in range(N)]
if (A1[0] in b)and (A1[1]in b)and (A1[2] in b):
    print('Yes')
elif (A2[0]in b)and(A2[1] in b)and(A2[2]in b):
    print('Yes')
elif (A3[0]in b)and(A3[1]in b)and (A3[2]in b):
    print('Yes')
elif (A1[0]in b)and(A2[0]in b)and(A3[0]in b):
    print('Yes')
elif (A1[1]in b)and (A2[1]in b)and(A3[1]in b):
    print('Yes')
elif (A1[2] in b)and (A2[2]in b)and(A3[2]in b):
    print('Yes')
elif (A1[0]in b)and (A2[1]in b)and(A3[2]in b):
    print('Yes')
elif (A1[2]in b)and (A2[1]in b)and(A3[0]in b):
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
#ABC159.B
A = list(map(int,input().split()))
N = int(input())
b = list(map(int,input().split()))

for i in b:
    if i in A:
        A[A.index(i)]=0
if A[0]==0 and A[1]==0 and A[2]==0:
    print('Yes')
elif A[3]==0 and A[4]==0 and A[5]==0:
    print('Yes')
elif A[6]==0 and A[7]==0 and A[8]==0:
    print('Yes')

elif A[0]==0 and A[3]==0 and A[6]==0:
    print('Yes')
elif A[1]==0 and A[4]==0 and A[7]==0:
    print('Yes')
elif A[2]==0 and A[5]==0 and A[8]==0:
    print('Yes')

elif A[0]==0 and A[4]==0 and A[8]==0:
    print('Yes')
elif A[2]==0 and A[4]==0 and A[6]==0:
    print('Yes')
else:
    print('No')

Fixed submission:
#ABC157.B
A1 = list(map(int,input().split()))
A2 = list(map(int,input().split()))
A3 = list(map(int,input().split()))
N = int(input())
b = [int(input())for _ in range(N)]
if (A1[0] in b)and (A1[1]in b)and (A1[2] in b):
    print('Yes')
elif (A2[0]in b)and(A2[1] in b)and(A2[2]in b):
    print('Yes')
elif (A3[0]in b)and(A3[1]in b)and (A3[2]in b):
    print('Yes')
elif (A1[0]in b)and(A2[0]in b)and(A3[0]in b):
    print('Yes')
elif (A1[1]in b)and (A2[1]in b)and(A3[1]in b):
    print('Yes')
elif (A1[2] in b)and (A2[2]in b)and(A3[2]in b):
    print('Yes')
elif (A1[0]in b)and (A2[1]in b)and(A3[2]in b):
    print('Yes')
elif (A1[2]in b)and (A2[1]in b)and(A3[0]in b):
    print('Yes')
else:
    print('No')