Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())


correct = [0] * (n+1)
wrong = [0] * (n+1)



for _ in range(m):
    problem,result_text = input().split()
    problem = int(problem)
    
    if result_text == "AC":
        correct[problem]=1
        
    
    if result_text == "WA":
        if correct[problem] == 0:
            wrong[problem] += 1
    

for _ in range(len(wrong)):
    if correct[problem] == 0:
        wrong[problem] = 0



print ( sum(correct), sum(wrong) )

Fixed submission:
n,m = map(int,input().split())


correct = [0] * (n+1)
wrong = [0] * (n+1)



for _ in range(m):
    problem,result_text = input().split()
    problem = int(problem)
    
    if result_text == "AC":
        correct[problem]=1
        
    
    if result_text == "WA":
        if correct[problem] == 0:
            wrong[problem] += 1
    

for problem in range(n+1):
    if correct[problem] == 0:
        wrong[problem] = 0



print ( sum(correct), sum(wrong) )
Buggy python submission (verdict: Runtime Error):
k,x = input()

text = "No"

if k*500>=x:
  text = "Yes"
  
print(text)

Fixed submission:
k,x = input().split(" ")
k = int(k)
x = int(x)



text = "No"
 
if k*500>=x:
  text = "Yes"
  
print(text +"\n")
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
h = [int(i) for i in input().split()]

def chmin(a, b):
    if a > b:
        return b
    else:
        return a
f_inf = pow(10,9)+99

dp = [f_inf] * (n+1)
dp[0] = 0
for i in range(1, n):
    for j in range(1, k+1):
        if i - j >= 0:
            dp[i] = chmin(dp[i], dp[i-j]+ abs(h[i] - h[i - j]))
print(dp[n-1])


Fixed submission:
import math

N = int(input())
data = list(map(int,input().split()))


BIG = pow(10,9)+7

dp = [BIG]*(N+1)

dp[0] = 0

for i in range(N):
    for j in range(i+1,i+3):
        if j<N:
            dp[j] = min(dp[j], dp[i] + abs(data[i]-data[j]))
            
print(dp[N-1])

Buggy python submission (verdict: Runtime Error):
N = int(input())
data = list(map(int(input().split()))
            
print ("11"+"\n")

Fixed submission:
import math

N = int(input())
data = list(map(int,input().split()))


BIG = pow(10,9)+7

dp = [BIG]*(N+1)

dp[0] = 0

for i in range(N):
    for j in range(i+1,i+3):
        if j<N:
            dp[j] = min(dp[j], dp[i] + abs(data[i]-data[j]))
            
print(dp[N-1])

Buggy python submission (verdict: Runtime Error):
N = input()
data = list(map(int(input().split()))
            
print (11)

Fixed submission:
import math

N = int(input())
data = list(map(int,input().split()))


BIG = pow(10,9)+7

dp = [BIG]*(N+1)

dp[0] = 0

for i in range(N):
    for j in range(i+1,i+3):
        if j<N:
            dp[j] = min(dp[j], dp[i] + abs(data[i]-data[j]))
            
print(dp[N-1])

Buggy python submission (verdict: Runtime Error):
N = input()
data = list(map(int(input().split()))
            
print ("11")

Fixed submission:
import math

N = int(input())
data = list(map(int,input().split()))


BIG = pow(10,9)+7

dp = [BIG]*(N+1)

dp[0] = 0

for i in range(N):
    for j in range(i+1,i+3):
        if j<N:
            dp[j] = min(dp[j], dp[i] + abs(data[i]-data[j]))
            
print(dp[N-1])
Buggy python submission (verdict: Runtime Error):
A, B = map(int,input().split())
if A < 6:
  print(0)
elif A > 12:
  print(B)
else:
  print(int(B/2)

Fixed submission:
A, B = map(int,input().split())
if A < 6:
  print(0)
elif A > 12:
  print(B)
else:
  print(int(B/2))
Buggy python submission (verdict: Runtime Error):
h,w=map(int,(input().split()))
r=0
for i in range(h):
    if i % 2 == 0:
        r+=(w+1)//2
    else:
        r+= w//2
print(r)


Fixed submission:
a=1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51
K=int(input())
print(a[K-1])
Buggy python submission (verdict: Runtime Error):
n,a,b=map(int,input().split())
t=0
r=0
for _ in range(10^100):
    if n <= t:
        print(r)
        break
    elif n >= a+t:
        t+=a+b
        r+=a
    else:
        r+=min(n-t,a)
        t+=a+b

Fixed submission:
s=input()
tmp=""
for i in s:
    if tmp != "":
        if tmp != i:
            print("Yes")
            exit()
    tmp = i
print("No")
Buggy python submission (verdict: Runtime Error):
a,b,c= map(int, input().split())
d=(b/a)
if d=> c:
  print(c)
else:
  print(d)

Fixed submission:
a,b,c= map(int, input().split())
d=int(b/a)
if d>= c:
  print(c)
else:
  print(d)

Buggy python submission (verdict: Runtime Error):
a,b,c= map(int, input().split())

if (b/a) => c:
  print(c)
else:
  print(b/a)

Fixed submission:
a,b,c= map(int, input().split())
d=int(b/a)
if d>= c:
  print(c)
else:
  print(d)
Buggy python submission (verdict: Runtime Error):
def gcd(a, b):
    while b:
		  a, b = b, a % b
    return a

a,b,c= map(int, input().split())
d= int(gcd(a,b))
if c==1:
  print(d)
else:
  arr=[]
  for i in range(1,d):
    if(d%i == 0):
      arr.append(i)
  print(arr[-(c-1)])

Fixed submission:
def gcd(x, y):
    if y == 0:
        return x
    else:
        return gcd(y, x % y)

a,b,c= map(int, input().split())
d= int(gcd(a,b))
if c==1:
  print(d)
else:
  arr=[]
  for i in range(1,d):
    if(d%i == 0):
      arr.append(i)
  print(arr[-(c-1)])

Buggy python submission (verdict: Runtime Error):
import fraction

a,b,c= map(int, input().split())
d= int(fraction.gcd(a,b))
if c==1:
  print(d)
else:
  arr=[]
  for i in range(1,d):
    if(d%i == 0):
      arr.append(i)
  print(arr[-(c-1)])

Fixed submission:
def gcd(x, y):
    if y == 0:
        return x
    else:
        return gcd(y, x % y)

a,b,c= map(int, input().split())
d= int(gcd(a,b))
if c==1:
  print(d)
else:
  arr=[]
  for i in range(1,d):
    if(d%i == 0):
      arr.append(i)
  print(arr[-(c-1)])

Buggy python submission (verdict: Runtime Error):
import fraction

a,b,c= map(int, input().split())
d= int(math.gcd(a,b))
if c==1:
  print(d)
else:
  arr=[]
  for i in range(1,d):
    if(d%i == 0):
      arr.append(i)
  print(arr[-(c-1)])

Fixed submission:
def gcd(x, y):
    if y == 0:
        return x
    else:
        return gcd(y, x % y)

a,b,c= map(int, input().split())
d= int(gcd(a,b))
if c==1:
  print(d)
else:
  arr=[]
  for i in range(1,d):
    if(d%i == 0):
      arr.append(i)
  print(arr[-(c-1)])

Buggy python submission (verdict: Runtime Error):
import math

a,b,c= map(int, input().split())
d= int(math.gcd(a,b))
if c==1:
  print(d)
else:
  arr=[]
  for i in range(1,d):
    if(d%i == 0):
      arr.append(i)
  print(arr[-(c-1)])

Fixed submission:
def gcd(x, y):
    if y == 0:
        return x
    else:
        return gcd(y, x % y)

a,b,c= map(int, input().split())
d= int(gcd(a,b))
if c==1:
  print(d)
else:
  arr=[]
  for i in range(1,d):
    if(d%i == 0):
      arr.append(i)
  print(arr[-(c-1)])
Buggy python submission (verdict: Runtime Error):
N= int(input())
h= list(map(int, input().split()))

dp=[N+1]

dp[0]= 0
dp[1]= h[0]

for i in range(1, N+1):
    dp[i]= min( (dp[n-1]+ abs(h[n]-h[n-1]) , dp[n-2]+ abs(h[n]-h[n-2])))

print(dp[N])


Fixed submission:
N= int(input())
h= list(map(int, input().split()))

dp=[0]*(N+1)

dp[0]= 0
dp[1]= abs(h[1]-h[0])

for i in range(2, N):
    # print((dp[i-1]+ abs(h[i]-h[i-1])))
    # print((dp[i-2]+ abs(h[i]-h[i-2])))
    # print()
    dp[i]= min( (dp[i-1]+ abs(h[i]-h[i-1])) , (dp[i-2]+ abs(h[i]-h[i-2])))
    # print(dp[i])

# print(dp)
print(dp[N-1])

Buggy python submission (verdict: Runtime Error):
N= int(input())
h= list(map(int, input()split()))

dp=[N+1]

dp[0]= 0
dp[1]= h[0]

for i in range(1, N+1):
    dp[i]= min( (dp[n-1]+ abs(h[n]-h[n-1]) , dp[n-2]+ abs(h[n]-h[n-2]))

print(dp[N])


Fixed submission:
N= int(input())
h= list(map(int, input().split()))

dp=[0]*(N+1)

dp[0]= 0
dp[1]= abs(h[1]-h[0])

for i in range(2, N):
    # print((dp[i-1]+ abs(h[i]-h[i-1])))
    # print((dp[i-2]+ abs(h[i]-h[i-2])))
    # print()
    dp[i]= min( (dp[i-1]+ abs(h[i]-h[i-1])) , (dp[i-2]+ abs(h[i]-h[i-2])))
    # print(dp[i])

# print(dp)
print(dp[N-1])
Buggy python submission (verdict: Runtime Error):
a,b= int(input().split())

if(a==1):
  a= 14

if(b==1):
  b= 14

if(a-b>0):
  print("Alice")
elif(a-b< 0):
  print("Bob")
else:
  print("Draw")
  

Fixed submission:
a,b= input().split()

int(a)
int(b)

if(a=='1'):
  a= 14

if(b=='1'):
  b= 14

if(int(a)-int(b)>0):
  print("Alice")
elif(int(a)-int(b)< 0):
  print("Bob")
else:
  print("Draw")
Buggy python submission (verdict: Runtime Error):
N = int(input())
R = int(input())
if N > 1 & N <100 & R > 0 & R < 4111 :
  if N >= 10 :
    print(R)

  else :
    print(R-100*(10-N))
else:
  print('error')

Fixed submission:
N,R = map(int,input().split())
if N >= 10:
  print(R)
else:
  print(R+100*(10-N))
Buggy python submission (verdict: Time Limit Exceeded):
import sys
sys.setrecursionlimit(10**7)

a,b,k = map(int,input().split())

for i in range(k):
    if a>0:
        a-=1
    elif b>0:
        b-=1
    else:
        pass

print(str(a)+" "+str(b))

Fixed submission:
a,b,k = map(int,input().split())

if k<=a:
    a -= k
elif k<a+b:
    b -= k-a
    a = 0
elif k>=a+b:
    a = 0
    b = 0

print(str(a)+" "+str(b))

Buggy python submission (verdict: Time Limit Exceeded):
import sys
sys.setrecursionlimit(10**7)

a,b,k = map(int,input().split())

for i in range(k):
    if a>0:
        a-=1
    elif b>0:
        b-=1
    else:
        pass

print(str(a)+" "+str(b))

Fixed submission:
a,b,k = map(int,input().split())

if k<=a:
    a -= k
elif k<a+b:
    b -= k-a
    a = 0
elif k>=a+b:
    a = 0
    b = 0

print(str(a)+" "+str(b))
Buggy python submission (verdict: Runtime Error):
n,x = map(int,input().split())
listl = []
listl += map(int,input().split())
# print(listl)

cnt=1
d=0
# print(d)
for i in range(n):
    d = d+listl[cnt]
    if d > x:
        break
    # print(d)
    cnt+=1

print(cnt)

Fixed submission:
n,x = map(int,input().split())
l = list(map(int,input().split()))
# print(listl)

cnt=1
d=0
# print(d)
for i in range(len(l)):
    d = d+l[i]
    if d > x:
        break
    # print(d)
    cnt+=1

print(cnt)

Buggy python submission (verdict: Runtime Error):
n,x = map(int,input().split())
listl = []
listl += map(int,input().split())
# print(listl)

cnt=0
d=0
# print(d)
while d <= x:
    d = d+listl[cnt]
    # print(d)
    cnt+=1

print(cnt)

Fixed submission:
n,x = map(int,input().split())
l = list(map(int,input().split()))
# print(listl)

cnt=1
d=0
# print(d)
for i in range(len(l)):
    d = d+l[i]
    if d > x:
        break
    # print(d)
    cnt+=1

print(cnt)
Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())

if A<=8 and B <=8:
    print("Yay!")
elif A>8 or B>8:
    print(":(")


Fixed submission:
S = input()
A,B = S.split()

A = int(A)
B = int(B)

if A<=8 and B <=8:
    print("Yay!")
elif A>8 or B>8:
    print(":(")
Buggy python submission (verdict: Runtime Error):
import math 

N2,M1 = map(int, input().split())
count=0
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

if N2!=0:
    count += combinations_count(N2,2)
if M1!=0:
    count += combinations_count(M1,2)

print(count)

Fixed submission:
import math 

N2,M1 = map(int, input().split())
count=0
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

if N2!=0 and N2!=1:
    count += combinations_count(N2,2)
if M1!=0 and M1!=1:
    count += combinations_count(M1,2)

print(count)

Buggy python submission (verdict: Runtime Error):
import math 

N2,M1 = map(int, input().split())

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


count = combinations_count(N2,2)

count += combinations_count(M1,2)

print(count)

Fixed submission:
import math 

N2,M1 = map(int, input().split())
count=0
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

if N2!=0 and N2!=1:
    count += combinations_count(N2,2)
if M1!=0 and M1!=1:
    count += combinations_count(M1,2)

print(count)

Buggy python submission (verdict: Runtime Error):
import math 

N2,M1 = map(int, input().split())

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

print(combinations_count(4, 2))

count = combinations_count(N2,2)

count += combinations_count(M1,2)

print(count)

Fixed submission:
import math 

N2,M1 = map(int, input().split())
count=0
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

if N2!=0 and N2!=1:
    count += combinations_count(N2,2)
if M1!=0 and M1!=1:
    count += combinations_count(M1,2)

print(count)
Buggy python submission (verdict: Runtime Error):
a= int(input())
b = list(map(int, input().split()))
answe = True


for i in range(a-1):
    if b[i] - b[i+1] >0:
        b[i] = b[i]-1

for i in range(a-1):
    if b[i] - b[i+1] >0:
        answe= False

if b[len(a-1)] < b[len(a-2)]:
    answe= False

if answe == True:
    print("Yes")
else:
    print("No")


Fixed submission:
a= int(input())
b = list(map(int, input().split()))

min = 0
for i in b:
    if min == i:
        continue
    if min > i:
        print("No")
        exit()
    if min < i :
        min = i-1



print("Yes")

Buggy python submission (verdict: Runtime Error):
a= int(input())
b = list(map(int, input().split()))
answe = True


for i in range(a-1):
    if b[i] - b[i+1] >0:
        b[i] = b[i]-1

for i in range(a-1):
    if b[i] - b[i+1] >0:
        answe= False

if b[len(a-1)] < b[len(a-2]:
    answe= False

if answe == True:
    print("Yes")
else:
    print("No")


Fixed submission:
a= int(input())
b = list(map(int, input().split()))

min = 0
for i in b:
    if min == i:
        continue
    if min > i:
        print("No")
        exit()
    if min < i :
        min = i-1



print("Yes")

Buggy python submission (verdict: Runtime Error):
a= int(input())
b = list(map(int, input().split()))
answe = True


for i in range(a-1):
    if b[i] - b[i+1] >0:
        b[i] = b[i]-1

for i in range(a-1):
    if b[i] - b[i+1] >0:
        answe= False

if b[i] > b[i+1]:
    answe= False

if answe == True:
    print("Yes")
else:
    print("No")

Fixed submission:
a= int(input())
b = list(map(int, input().split()))

min = 0
for i in b:
    if min == i:
        continue
    if min > i:
        print("No")
        exit()
    if min < i :
        min = i-1



print("Yes")
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())

ans = b
if a <= 5:
  ans = 0
elif a <= 12:
  ans = b/s

print(ans)

Fixed submission:
a,b = map(int,input().split())
 
ans = b
if a <= 5:
  ans = 0
elif a <= 12:
  ans = int(b/2)
 
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
r,g,b,n = map(int,input().split())
ans = 0

for i in range(n + 1):
  for j in range(n + 1):
    tmp = n - i*r - j*g
    if tmp >= 0 and tmp%b == 0:
      ans += 1

print(ans)


Fixed submission:
r,g,b,n = map(int,input().split())
ans = 0

for i in range(n + 1):
  for j in range(n + 1):
    tmp = n - i*r - j*g
    if tmp >= 0 and tmp%b == 0:
      ans += 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
r,b,g,n = map(int,input().split())

c = []
ans = 0
c.append(int(n/r))
c.append(int(n/b))
c.append(int(n/g))

for i in range(c[0]+1):
  for j in range(c[1]+1):
    for k in range(c[2]+1):
      if (i*r + j*b + k*g) == n:
        ans += 1

print(ans)

Fixed submission:
r,g,b,n = map(int,input().split())
ans = 0

for i in range(n + 1):
  for j in range(n + 1):
    tmp = n - i*r - j*g
    if tmp >= 0 and tmp%b == 0:
      ans += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = list(input())
c = 0
b = s[:n-1].count('#')
w = s[1:].count('.')
for i in range(n-1):
 if s[i] == '#' and s[i + 1] == '.':
  c += 1
  s[i +1] = '#'

print(min(c,b,w))

Fixed submission:
a,b,c = map(int,input().split())
 
if c == min(a,b,c):
 print('No')
elif c == max(a,b,c):
 print('No')
else:
 print('Yes')

Buggy python submission (verdict: Runtime Error):
n = int(input())
s = list(input())
c = 0
b = s[:n-1].count('#')
w = s[:n-1].count('.')
for i in range(n-1):
 if s[i] == '#' and s[i + 1] == '.':
  c += 1
  s[i +1] = '#'

print(min(c,b,w))

Fixed submission:
a,b,c = map(int,input().split())
 
if c == min(a,b,c):
 print('No')
elif c == max(a,b,c):
 print('No')
else:
 print('Yes')
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = list(input())
c = 0
b = s.count('#')
for i in range(n):
 if s[i] == '#' and s[i + 1] == '.':
  c += 1
  s[i +1] = '#'

print(min(c,b))

Fixed submission:
n = int(input())
s = input()
ans = s.count('.')
num = ans
for c in s:
  if c == '.':
    num -= 1
  else:
    num += 1
  
  ans = min(ans,num)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
s = input()

count = 0

while True:
    cnt = s.count("BW")
    if cnt > 0:
        s = s.replace("BW", "WB")
        count += cnt
    else:
        break

print(count)


Fixed submission:
s = list(input())

count = 0
w_cnt = 0

for index in range(len(s))[::-1]:
    if s[index] == "W":
        w_cnt += 1
    else:
        count += w_cnt

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
s = list(input())

count = 0
check_count = -1
while True:
    if count == check_count:
        break
    else:
        check_count = count
    for index in range(len(s) - 1):
        if s[index] == "B" and s[index + 1] == "W":
            s[index] = "W"
            s[index + 1] = "B"
            count += 1

print(count)

Fixed submission:
s = list(input())

count = 0
w_cnt = 0

for index in range(len(s))[::-1]:
    if s[index] == "W":
        w_cnt += 1
    else:
        count += w_cnt

print(count)
Buggy python submission (verdict: Runtime Error):
import math

def main():
    a, b, c = map(int, input().split())
    
    top = max([a, b, c])
    bot = min([a, b, c])
    mid = 0
    for x in [a, b, c]:
        if top != x and bot != x:
            mid = x
    count = 0
    
    count = top - mid
    bot += count
    mid += count
    
    if (top - bot) % 2 == 0:
        count += (top - bot) / 2 
    else:
        count += math.ceil((top - bot) / 2)+1
        
    print(int(count), end="")
    print()

if __name__ == '__main__':
    main()


Fixed submission:
def main():
    a = input()
    if 'a' in a and 'b' in a and 'c' in a:
        print("Yes", end="")
    else:
        print("No", end="")

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Runtime Error):
def main():
    a = input()
    if 'a' in a and 'b' in a and 'c' in a:
        print("yes", end=")
    else:
        print("no", end=")

if __name__ == "__main__":
    main()   

Fixed submission:
def main():
    a = input()
    if 'a' in a and 'b' in a and 'c' in a:
        print("Yes", end="")
    else:
        print("No", end="")

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    a, b, k = map(int, input().split())
    
    li = list(filter(lambda x: x <= a+k-1 or b-k+1 <= x 
        , [x for x in range(a, b+1)]))
    
    for i in li:
        print(i)

if __name__ == "__main__":
    main()


Fixed submission:
def main():
    a, b, k = map(int, input().split())
    
    s = set()

    for i in range(a, a+k):
        s.add(i)

    for i in range(b-k+1, b+1):
        s.add(i)

    for i in sorted(s):
        if a <= i and i <= b:
            print(i)

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    a, b, k = map(int, input().split())
    
    for x in range(a, b+1):
        if x <= a+k-1 or b-k+1 <= x:
            print(x) 
    
if __name__ == "__main__":
    main()

Fixed submission:
def main():
    a, b, k = map(int, input().split())
    
    s = set()

    for i in range(a, a+k):
        s.add(i)

    for i in range(b-k+1, b+1):
        s.add(i)

    for i in sorted(s):
        if a <= i and i <= b:
            print(i)

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    a, b, k = map(int, input().split())
    
    for x in range(a, b+1):
        if x <= a+k-1 or b-k+1 <= x:
            print(x) 
    
if __name__ == "__main__":
    main()

Fixed submission:
def main():
    a, b, k = map(int, input().split())
    
    s = set()

    for i in range(a, a+k):
        s.add(i)

    for i in range(b-k+1, b+1):
        s.add(i)

    for i in sorted(s):
        if a <= i and i <= b:
            print(i)

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
    N, M = list(map(int, input().split(' ')))
    r = [ None for i in range(N) ]
     
    illegal = False
    for i in range(M):
      s, c = list(map(int, input().split(' ')))
      if r[s-1] is not None and r[s-1] != c:
        illegal = True
        break
      r[s-1] = c
     
    v = -1
    if not illegal:
      for i in range(N):
        if r[i] is None:
          if i == 0 and N != 1:
            r[i] = 1
          else:
            r[i] = 0
      v = sum(r[i] * 10**i for i in range(N))
      if v < 10**(N-1) and not (N == 1 and v == 0):
        v = -1
     
    print(v)

Fixed submission:
import math
print(math.ceil(int(input())/2))
Buggy python submission (verdict: Runtime Error):
R = 3
r = [ list(map(int, input().split(' '))) for i in range(R) ]

def check():
  for y in range(R):
    f = True
    for x in range(R):
      if r[y][x] != 0:
        f = False
        break
    if f:
      return True
 
  for x in range(R):
    f = True
    for y in range(R):
      if r[y][x] != 0:
        f = False
	    break
    if f:
      return True
 
  f = True
  for p in range(R):
    if r[p][p] != 0:
      f = False
      break
  if f:
    return True
 
  f = True
  for p in range(R):
    if r[R-1-p][p] != 0:
      f = False
      break
  return f
 
N = int(input())
for i in range(N):
  v = int(input())
  
  for y in range(R):
    for x in range(R):
      if r[y][x] == v:
        r[y][x] = 0
 
print('Yes' if check() else 'No')

Fixed submission:
R = 3
r = [ list(map(int, input().split(' '))) for i in range(R) ]

def check():
  for y in range(R):
    f = True
    for x in range(R):
      if r[y][x] != 0:
        f = False
        break
    if f:
      return True
 
  for x in range(R):
    f = True
    for y in range(R):
      if r[y][x] != 0:
        f = False
        break
    if f:
      return True
 
  f = True
  for p in range(R):
    if r[p][p] != 0:
      f = False
      break
  if f:
    return True
 
  f = True
  for p in range(R):
    if r[R-1-p][p] != 0:
      f = False
      break
  return f
 
N = int(input())
for i in range(N):
  v = int(input())
  
  for y in range(R):
    for x in range(R):
      if r[y][x] == v:
        r[y][x] = 0
 
print('Yes' if check() else 'No')

Buggy python submission (verdict: Runtime Error):
R = 3
r = []
for i in range(R):
  r[i] = list(map(int, input().split(' ')))

def check():
  for y in range(R):
    f = True
    for x in range(R):
      if r[y][x] != 0:
        f = False
    if f:
      return True

  for x in range(R):
    f = True
    for y in range(R):
      if r[y][x] != 0:
        f = False
    if f:
      return True

  f = True
  for p in range(R):
    if r[p][p] != 0:
	    f = False
  if f:
    return True

  f = True
  for p in range(R):
    if r[R-1-p][p] != 0:
	    f = False
  return f

N = input()
for i in range(N):
  v = int(input())
  
  for y in range(R):
    for x in range(R):
      if r[y][x] == v:
        r[y][x] = 0

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


Fixed submission:
R = 3
r = [ list(map(int, input().split(' '))) for i in range(R) ]

def check():
  for y in range(R):
    f = True
    for x in range(R):
      if r[y][x] != 0:
        f = False
        break
    if f:
      return True
 
  for x in range(R):
    f = True
    for y in range(R):
      if r[y][x] != 0:
        f = False
        break
    if f:
      return True
 
  f = True
  for p in range(R):
    if r[p][p] != 0:
      f = False
      break
  if f:
    return True
 
  f = True
  for p in range(R):
    if r[R-1-p][p] != 0:
      f = False
      break
  return f
 
N = int(input())
for i in range(N):
  v = int(input())
  
  for y in range(R):
    for x in range(R):
      if r[y][x] == v:
        r[y][x] = 0
 
print('Yes' if check() else 'No')