Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p02817 (python)

Fixed submission:
s, t = input().split()
print(t + s)

Buggy submission (verdict: Runtime Error):
s = input()
t = input()
print(t + s)

Buggy submission (verdict: Runtime Error):
s = input()
t = input()
print(t, s, sep="")

Buggy submission (verdict: Runtime Error):
s = input().strip()
t = input().strip()
print(t, s, sep="")
Problem p02898 (python)

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

able_to_ride = [p for p in h if p >= k]
print(len(able_to_ride))

Buggy submission (verdict: Runtime Error):
n, k = list(map(int, input().split()))
h = list(map(int, input().split()))

able_to_ride = [p for p in h if h >= k]
print(len(able_to_ride))
Problem p03645 (python)

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

for i in range(m):
	a, b = map(int, input().split())

	if a == 1:
		side1.add(b)
	
	elif b == n:
		side2.add(a)

print(("" if side1 & side2 else "IM") + "POSSIBLE")

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
info = sorted([list(map(int, input().split())) for _ in range(m)])

q = []
for i in range(m):
	if info[i][0] == 1:
		q.append(info[i][1])
	else:
		t = i
		break

for j in range(t, m):
	if info[j][0] in q:
		if info[j][1] == n:
			print("POSSIBLE")
			break
else:
	print("IMPOSSIBLE")
Problem p02719 (python)

Fixed submission:
n,k=[int(x) for x in input().split()]
#Sequence decreases first then starts increasing.This point has to be identified.
prev,cur=n+1,n
if k<=0:
  print(n)
else:
	rem = n%k
	print(min(rem,abs(rem-k)))

Buggy submission (verdict: Runtime Error):
n,k=[int(x) for x in input().split()]
#Sequence decreases first then starts increasing.This point has to be identified.
prev,cur=n+1,n
if k<=0:
  print(n)
else:
	rem = n%k
    print(abs(rem-k))

Buggy submission (verdict: Runtime Error):
n,k=[int(x) for x in input().split()]
#Sequence decreases first then starts increasing.This point has to be identified.
prev,cur=n+1,n
if k<=0:
  print(n)
else:
	rem = n%k
    print(abs(rem-k))
Problem p03160 (python)

Fixed submission:


def solution(h):
    n = len(h)
    INF = float('inf')
    dp = [INF]*n
    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(h[i]-h[j]) )
    
    return dp[n-1]

N = int(input())
h = list(map(int,input().split()))
res = solution(h)
print(res)

Buggy submission (verdict: Runtime Error):


def solution(h):
    n = len(h)
    for i in range(n):
        for j in range(i+1,i+3):
            if j < n:
                dp[j] = min(dp[j] , dp[i]+abs(h[i]-h[j]) )
    return dp[n-1]

N = int(input())
h = list(map(int,input().split()))
res = solution(h)
print(res)
Problem p03162 (python)

Fixed submission:

#B- Frog 2

def solution(nums):
    n = len(nums)
    dp = [0,0,0]
    for day in range(n):
        new_dp = [0,0,0]
        for i in range(3):
            for j in range(3):
                if i!=j:
                    new_dp[i] = max(new_dp[i] , dp[j]+ nums[day][i] )
        dp = new_dp
    return max(dp[0],dp[1],dp[2])

N = int(input())
nums = []
for _ in range(N):    
    day = list(map(int,input().split()))
    nums.append(day)
res = solution(nums)
print(res)

Buggy submission (verdict: Runtime Error):

#B- Frog 2

def solution(nums):
    if not nums:return 0
    INF = float('-inf')
    n = len(nums[0])

    def dp(pre,cur,total = set([0,1,2])):
        if cur == n:
            return 0
        take = total - set([pre])
        res = INF
        for x in take:
            cand =  nums[x][cur] + dp(x,cur+1)
            if cand > res:
                res = cand
        return res
    return dp(-1,0)

N = int(input())
nums = [[],[],[]]
for _ in range(N):    
    a,b,c = list(map(int,input().split()))
    nums[0].append(a)
    nums[1].append(b)
    nums[2].append(c)
res = solution(nums)
print(res)
Problem p02718 (python)

Fixed submission:
t = list(map(int,input().split()))
a = list(map(int,input().split()))
s = sum(a)
count = 0

for i in range(t[0]):
    if a[i] >= s/(4 * t[1]):
        count += 1

if count >= t[1]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
m = int(input())
a = list(map(int,input().split()))
sum = sum(a)
count = 0

for i in range(len(a)):
    if a[i] >= sum/(4*m):
        count += 1

if count == m:
    print("Yes")
else:
    print("No")
Problem p03644 (python)

Fixed submission:
n = int(input())
box  = []
prime = []
ans = 0
def Prime_Factorization(n):
    i = 2
    prime_factors = []
    while n > 1:
        if n % i == 0:
            prime_factors.append(i)
            n = n / i
        else:
            i += 1
    return prime_factors

for i in range(1,n+1):
    prime = Prime_Factorization(i)
    box.append(prime.count(2))
    #print(box)


if n == 1:
    print(1)
else:
    ans = box.index(max(box)) + 1
    print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
box  = []
prime = []
ans = 0
def Prime_Factorization(n):
    i = 2
    prime_factors = []
    while n > 1:
        if n % i == 0:
            prime_factors.append(i)
            n = n / i
        else:
            i += 1
    return prime_factors

for i in range(1,n):
    prime = Prime_Factorization(i)
    box.append(prime.count(2))
    #print(box)

ans = box.index(max(box)) + 1
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
box  = []
prime = []

def Prime_Factorization(n):
    i = 2
    prime_factors = []
    while n > 1:
        if n % i == 0:
            prime_factors.append(i)
            n = n / i
        else:
            i += 1
    return prime_factors

for i in range(1,n):
    prime = Prime_Factorization(i)
    box.append(prime.count(2))
    #print(box)

ans = box.index(max(box)) + 1
print(ans)
Problem p02717 (python)

Fixed submission:
a, b, c = map(int, input().split())
print('{} {} {}'.format(c, a, b))

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().sprit())
print('{} {} {}'.format(c, a, b))

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().sprit())
print('{} {} {}'.format(c, a, b))
Problem p02952 (python)

Fixed submission:
num_str = input()
if len(num_str) == 1:
  odd_num = int(num_str)
elif len(num_str) == 2:
  odd_num = 9
elif len(num_str) == 3:
  odd_num = 9 + (int(num_str) - 99)
elif len(num_str) == 4:
  odd_num = 909
elif len(num_str) == 5:
  odd_num = 909 + (int(num_str) - 9999)
else:
  odd_num = 90909
  
print(odd_num)

Buggy submission (verdict: Runtime Error):
num_str = input()
if len(nums_str) == 1:
  odd_num = int(num_str)
elif len(num_str) == 2:
  odd_num = 9
elif len(num_str) == 3:
  odd_num = 9 + (int(num_str) - 99)
elif len(num_str) == 4:
  odd_num = 909
elif len(num_str) == 5:
  odd_num = 909 + (int(num_str) - 9999)
else:
  odd_num = 90909
  
print(odd_num)

Buggy submission (verdict: Runtime Error):
num_str = input()
odd_num = 0
if (len(num_str) == 2):
  odd_num = 9
else if (len(num_str) == 3):
  odd_num = 9 + (int(num_str) - 99)
else if (len(num_str) == 4):
  odd_num = 909
else if (len(num_str) == 5):
  odd_num = 909 + (int(num_str) - 9999)
else:
  odd_num = 90909
print(odd_num)
Problem p02953 (python)

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

ans = "Yes"

if n != 1:
  for i in range(n-1):
    if h[i]-1>h[i+1]:
      ans = "No"
      break
    elif h[i]-1==h[i+1]:
      h[i+1] += 1
      
print(ans)

Buggy submission (verdict: Runtime Error):
import copy

mas_num = int(input())
h = list(map(int, input().split()))
c = copy.copy(h)
d = copy.copy(h)
c.pop(0)
d.pop(0)
d.pop(0)

if h[-2] - 1 > h[-1]:
    print('No')
else:
    for i,j,k in zip(h, c, d):
        if i - 1 > j:
            print('No')
            break
        else:
            if i - 1 > k:
                print('No')
                break
            else:
                print('Yes')
                break

Buggy submission (verdict: Runtime Error):
import copy

mas_num = int(input())
h = list(map(int, input().split()))
c = copy.copy(h)
d = copy.copy(h)
c.pop(0)
d.pop(0)
d.pop(0)

for i,j,k in zip(h, c, d):
    if i - 1 > j:
        print('No')
        break
    else:
        if i - 2 > k:
            print('No')
            break
        else:
            if h[-2] - 1 > h[-1]:
                print('No')
                break
            else:
                print('Yes')
                break
Problem p02958 (python)

Fixed submission:
import copy

n = int(input())
p = list(map(int, input().split()))

q = copy.copy(p)

q.sort()

kaisu = 0

for i in range(n):
  if p[i] != q[i]:
    kaisu += 1

if kaisu == 0 or kaisu == 2:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
import copy

n = int(input())
p = list(map(int, input().split()))

q = copy.copy(p)

r = q.sort()

kaisu = 0

for i in range(n):
  if p[i] != r[i]:
    kaisu += 1

if kaisu == 0 or kaisu == 2:
  print("YES")
else:
  print("NO")
Problem p03494 (python)

Fixed submission:
n = int(input())
nums = [int(i) for i in input().split()]

kaisu = 0

while True:
  if [i for i in nums if i % 2 == 1]:
    break
  nums = [i//2 for i in nums]
  kaisu += 1
print(kaisu)

Buggy submission (verdict: Runtime Error):
n = int(input())
# nums = list(map(int, input().split()))
nums = [int(i) for i in input().split()]

kaisu = 0

while True:
  
"""
  for i in range(n):
    if nums[i] %2 == 0:
      nums[i] = nums[i]/2
      kaisu += 1
    else:
      break
"""
  if [i for i in nums if i % 2 == 1]:
    break
  nums = [i//2 for i in nums]
  kaisu += 1
print(kaisu)
Problem p02717 (python)

Fixed submission:
a, b, c = input().split()
print(str(c) + " " + str(a) + "  " +  str(b))

Buggy submission (verdict: Runtime Error):
n, m = input().split()
b = input().split()
sum = 0
for x in b:
    sum += int(x)
yy=0
for y in b:
    if int(y) > sum/(4*int(m)):
        yy+=1
if yy <= int(m):
    print("No")
else:
    print("Yes")
Problem p02718 (python)

Fixed submission:
n, m = input().split()
b = input().split()
sum = 0
for x in b:
    sum += int(x)
yy=0
for y in b:
    if int(y) >= sum/(4*int(m)):
        yy+=1
if yy < int(m):
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
a,a1 = input().split()
b = input().split()
sum = 0
for _ in b:
    sum += int(_)
if int(b[int(a1)]) >= sum/(4*int(a1)):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a,a1 = input().split()
b = input().split()
sum = 0
for _ in b:
    sum += int(_)
if int(b[int(a1) - 1]) >= sum/(4*a1):
    print("Yes")
else:
    print("No")
Problem p02717 (python)

Fixed submission:
a,b,c = input().split()
print(str(c)+" "+str(a)+" "+str(b))

Buggy submission (verdict: Runtime Error):
a,b,c = mapt(int,input().split())
res = str(c)+""+str(a)+""+str(b)
print(res)

Buggy submission (verdict: Runtime Error):
a,b,c = raw_input().split()
a,b,c = c,a,b

print(a,b,c)

Buggy submission (verdict: Runtime Error):
a,b,c = raw_input().split()

arr = [a,b,c]

print(arr[2],arr[0],arr[1])

Buggy submission (verdict: Runtime Error):
a,b,c = raw_input().split()
arr = [a,b,c]

print(arr[1],arr[2],arr[0])
Problem p02969 (python)

Fixed submission:
r = int(input())
print(3 * r * r)

Buggy submission (verdict: Runtime Error):
N = int(input())
A =[]
for i in range(N):
  A.append(int(input()))
m = max(A)
j = A.index(m)
for k in range(N):
  if k != j:
    print(m)
  else:
    B = A[:]
    del B[j]
    print(max(B))
Problem p02755 (python)

Fixed submission:
import numpy as np

s = np.array(input().split()).astype(int)
# =============================================================================
# if s.find("A") >= 0 and s.find("B") >= 0:
#     print("Yes")
# else:
#     print("No")
# =============================================================================

# =============================================================================
# N,A,B = s
# 
# print(N//(A+B)*A + np.array([N%(A+B),A]).min())
# =============================================================================

A,B = s

eight =  100/8
ten = 100/10
x1 = A*eight
x2 = A*ten
ans = []

for i in np.arange(0,np.array([x1,x2]).max().astype(int) + 100):
    if int(i * 1/eight) == A and int(i * 1/ten) == B:
        ans.append(i)
if len(ans) == 0:
    print(-1)
else:
    print(np.array(ans).min().astype(int))

Buggy submission (verdict: Runtime Error):
import numpy as np

s = np.array(input().split()).astype(int)
# =============================================================================
# if s.find("A") >= 0 and s.find("B") >= 0:
#     print("Yes")
# else:
#     print("No")
# =============================================================================

# =============================================================================
# N,A,B = s
# 
# print(N//(A+B)*A + np.array([N%(A+B),A]).min())
# =============================================================================

A,B = s

eight =  100/8
ten = 100/10
x1 = A*eight
x2 = A*ten
ans = []
ans2 = []
if x1 == x2:
    ans.append(x1)
else:
    for i in range(0,np.array([x1,x2]).max().astype(int)):
        if int(i * 1/eight) == A and int(i * 1/ten) == B:
            ans.append(i)
        ans2.append(i)
if (int)(A * 10/8) != B:
    print(-1)
else:
    print(np.array(ans).min().astype(int))

Buggy submission (verdict: Runtime Error):
import numpy as np

s = np.array(input().split()).astype(int)
# =============================================================================
# if s.find("A") >= 0 and s.find("B") >= 0:
#     print("Yes")
# else:
#     print("No")
# =============================================================================

# =============================================================================
# N,A,B = s
# 
# print(N//(A+B)*A + np.array([N%(A+B),A]).min())
# =============================================================================

A,B = s

eight =  100/8
ten = 100/10
x1 = A*eight
x2 = A*ten
ans = []
ans2 = []
if x1 == x2:
    ans.append(x1)
else:
    for i in range(np.array([x1,x2]).min().astype(int),np.array([x1,x2]).max().astype(int)+1):
        if int(i * 1/eight) == A and int(i * 1/ten) == B:
            ans.append(i)
        ans2.append(i)
if (int)(A * 10/8) != B:
    print(-1)
else:
    print(np.array(ans).min().astype(int))
Problem p02765 (python)

Fixed submission:
N,R = input().split()

N = int(N)
R = int(R)

if N >= 10:
    print(R)
else:
    print(R + 100*(10-N))

Buggy submission (verdict: Runtime Error):
N,R = input()

N = int(N)
R = int(R)

if N >= 10:
    print(R)
else:
    print(100*(10-N))
Problem p02886 (python)

Fixed submission:
n = int(input())
d = list(map(int, input().split())) 
s=0
# print(d)
for i in range(n):
   for j in range(i+1,n):
      s += d[i]*d[j]
print(s)

Buggy submission (verdict: Runtime Error):
n = int(input())
d = set(map(int, input().split())) 
s=0

for i in range(n):
   for j in range(i+1,n):
      s += d[i]*d[j]
print(s)
Problem p02922 (python)

Fixed submission:
a = list(map(int,input().split()))
# sum_a = a[0]+(a[0]-1)+(a[0]-1)
b=0
for i in range(100000000):
   if(a[1]==1):
      break
   if(i==0):
      if(b>=a[1]): 
         break
      b=a[0]
   else:
      if(b>=a[1]):
         break
      b=b+(a[0]-1)

print(i)

Buggy submission (verdict: Runtime Error):
a = list(map(int,input().split()))
# sum_a = a[0]+(a[0]-1)+(a[0]-1)
sum_a=0
for i in range(100000000):
   if(sum_a>＝a[1]):
      break
   if(i==0):
      sum_a=a[0]
   else:
      sum_a=sum_a+(a[0]-1)

print(i)
Problem p03777 (python)

Fixed submission:
#coding:utf-8
# x=int(raw_input())  # 1 # 一つの数字のみ
x,y=map(str,raw_input().split())  # 2 3  # 二つの数字
# x,z=raw_input()  # 文字列
# print x,y,z
# sum =/ x[0]+y[0]+y[1]
# s = z[0]
if x =="H":
    print y
elif x =="D":
    if y=="D":
        print "H"
    elif y=="H":
        print "D"
elif x =="D":
    if y =="D":
        print"D"
    elif y =="H":
        print"H"
# prin?t x,y

Buggy submission (verdict: Runtime Error):
#coding:utf-8
x=int(raw_input())  # 1 # 一つの数字のみ
# w, a, b =map(int,raw_input().split())  # 2 3  # 二つの数字
sums=0
for i in range(14145):
    sums += i
    # if x == place:
    # print sum
    # print i
    if sums < x:
        pass
    elif sums >= x:
        print i
        break
Problem p02717 (python)

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

Buggy submission (verdict: Runtime Error):
a,b,c = list(map(int,input().split()))
a,b = b,a
a,c = c,a
print(f'{a} {b} {c}')
Problem p02717 (python)

Fixed submission:
abc = input()
s = abc.split(" ")
print(s[2] + " " + s[0] + " " + s[1])

Buggy submission (verdict: Runtime Error):
    abc = input()
    abc.split(" ")
    print(abc[2] + " " + abc[0] + " " + abc[1])
Problem p02783 (python)

Fixed submission:
h, a = map(int, input().split())
print(-(-h // a))

Buggy submission (verdict: Runtime Error):
h, a = map(int, input())
print(-(-h // a))
Problem p02717 (python)

Fixed submission:
n=list(input().split(" "))
print(n[2],end=" ")
print(n[0],end=" ")
print(n[1],end=" ")

Buggy submission (verdict: Runtime Error):
x=int(input())
y=int(input())
z=int(input())
print(z)
print(x)
print(y)
Problem p02718 (python)

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

lis2=sorted(lis2,reverse=True)
sum1=sum(lis2)
count=0
for i in range(0,m):
  if(lis2[i]>=((1/(4*m))*sum1)):
    count=0
  else:
    count=1
    break
if(count==1):
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split(" "))
lis2=[]
for i in range(0,n):
	lis2.append(int(input()))
lis2=sorted(lis2,reverse=True)
sum1=sum(lis2)
count=0
for i in range(0,m):
  if(lis2[i]>=((1/(4*m))*sum1)):
    count=0
  else:
    count=1
    break
if(count==1):
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split(" "))
lis2=[]
for i in range(0,n):
	lis2.append(int(input()))
lis2=sorted(lis2,reverse=True)
sum1=sum(lis2)
count=0
for i in range(0,m):
  if(lis2[i]>=((1/(4*m))*sum1)):
    count=0
  else:
    count=1
    break
if(count==1):
  print("No")
else:
  print("Yes")
Problem p03145 (python)

Fixed submission:
A = list(map(int,input().split()))
print(A[0]*A[1]//2)

Buggy submission (verdict: Runtime Error):
A = map(int,input().split())
print(0.5*A[0]*A[1])

Buggy submission (verdict: Runtime Error):
A = map(int,input().split())
sort(A)
print(0.5*A[0]*A[1])

Buggy submission (verdict: Runtime Error):
A = map(int,input().split())
A.remove(max(A))
print(0.5*(A[0])*(A[1]))
Problem p03210 (python)

Fixed submission:
X= int(input())
if X == 3 or X == 7 or X == 5:
	print("YES")
else:
	print("NO")

Buggy submission (verdict: Runtime Error):
X= int(input())
if X == 3 || X == 7 || X == 5:
	print("YES")
else:
	print("NO")
Problem p03261 (python)

Fixed submission:
N = int(input())
words = []
for inp in range(N):
	words.append(input())

frst = words[0]
wrds = set(words)
if len(wrds) != len(words):
	print("No")
else:	
	for i in range(1,len(words)):
		flag = 1
		if words[i-1][-1] != words[i][0]:
			print("No")
			flag = 0
			break
	if flag == 1:
		print("Yes")

Buggy submission (verdict: Runtime Error):
words = []
for inp in range(N):
	words.append(input())

frst = words[0]
for i in range(1,len(words)):
	if words[i-1][-1] != words[i][0]:
		print("No")
		break
	else:
		flag = 0
		if words[i] in words[:i-1]:
			print("No")
			break
		else:
			flag = 1
if flag == 1:
	print("Yes")

Buggy submission (verdict: Runtime Error):
N = int(input())
words = input().split("\n")

frst = words[0]
last = words[-1]
if frst[0] !=  last[-1]:
	print("No")
else:
	
	for i in range(1,len(words)):
		flag = 0
		if words[i] in words[:i-1]:
			print("No")
			break
		else:
			flag = 1
	if flag == 1:
		print("Yes")
Problem p02730 (python)

Fixed submission:
s=input()
sl=len(s)
if s[:int((sl-1)/2)]==s[int(((sl+3)/2)-1):]:
    print('Yes')
else :
    print('No')

Buggy submission (verdict: Runtime Error):
s=input()
sl=len(s)
if s[:(sl-1)/2]==s[((sl+3)/2)-1:]:
    print('Yes')
else :
    print('No')
Problem p02732 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
cnt=[0]*(n+1)
ans=0
for i in range(n):
    cnt[a[i]]+=1
for j in range(n+1):
    ans+=(cnt[j]*(cnt[j]-1))//2
for k in range(n):
    print(ans-(cnt[a[k]]-1))

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
ans=[]
for i in range(n):
    for j in range(n):
        if i!=j:
            for k in range(j+1,n):
                if a[j]==a[k]:
                    ans[i]+=1
for i in range(n):
    print(ans[n])
Problem p02743 (python)

Fixed submission:
import math
a,b,c=map(int,input().split())
if c-a-b<0:
    print('No')
elif 4*a*b<(c-a-b)**2:
    print('Yes')
else :
    print('No')

Buggy submission (verdict: Runtime Error):
import math
a,b,c=map(int,input().split())
a=math.sqrt(a)
b=math.sqrt(b)
c=math.sqrt(c)
s=a+b
if s<＝c:
    print('Yes')
else :
    print('No')
Problem p02755 (python)

Fixed submission:
import math
a,b=map(int,input().split())
b*=10
ans=0

for i in range(9):
    j=b
    j+=i 
    if int(j*0.08)==a:
        ans=j
        break
if ans!=0:
    print(ans)
else :
    print(-1)

Buggy submission (verdict: Runtime Error):
import math
a,b=map(int,input().split())
b*=10
ans=0

for i in range(8):
    j=b
    j+=i 
   if math.floor(j*0.08)==a:
       ans=j
       break
if ans!=0:
    print(ans)
else :
    print(-1)

Buggy submission (verdict: Runtime Error):
import math
a,b=map(int,input().split())
b*=10
ans=0

for i in range(8):
    j=b
    j+=i 
   if math.floor(j*0.08)==a:
       ans=j
       break
if ans!=0:
    print(ans)
else :
    print(-1)
Problem p02760 (python)

Fixed submission:
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 i in range(n)]
for i in range(3):
    for j in range(n):
        if a1[i] == b[j]:
            a1[i] = 1
        elif a2[i] == b[j]:
            a2[i] = 1
        elif a3[i] == b[j]:
            a3[i] = 1
 
if a1[0] == a1[1] == a1[2]:
    print("Yes")
elif a2[0] == a2[1] == a2[2]:
    print("Yes")
elif a3[0] == a3[1] == a3[2]:
    print("Yes")
elif a1[0] == a2[0] == a3[0]:
    print("Yes")
elif a1[1] == a2[1] == a3[1]:
    print("Yes")
elif a1[2] == a2[2] == a3[2]:
    print("Yes")
elif a1[0] == a2[1] == a3[2]:
    print("Yes")
elif a1[2] == a2[1] == a3[0]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a1=[map(int(),input().split())]
a2=[map(int(),input().split())]
a3=[map(int(),input().split())]
n=int(input())
b=[input() for i in range(n)]
for i in range(3):
    for j in range(n):
        if a1[i] == b[j]:
            a1[i] = 1
        elif a2[i] == b[j]:
            a2[i] = 1
        elif a3[i] == b[j]:
            a3[i] = 1
 
if a1[0] == a1[1] == a1[2]:
    print("Yes")
elif a2[0] == a2[1] == a2[2]:
    print("Yes")
elif a3[0] == a3[1] == a3[2]:
    print("Yes")
elif a1[0] == a2[0] == a3[0]:
    print("Yes")
elif a1[1] == a2[1] == a3[1]:
    print("Yes")
elif a1[2] == a2[2] == a3[2]:
    print("Yes")
elif a1[0] == a2[1] == a3[2]:
    print("Yes")
elif a1[2] == a2[1] == a3[0]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a1=[map(int(),input().split())]
a2=[map(int(),input().split())]
a3=[map(int(),input().split())]
n=int(input())
b=[input() for i in range(n)]
for i in range(3):
    for j in range(N):
        if a1[i] == b[j]:
            a1[i] = 1
        elif a2[i] == b[j]:
            a2[i] = 1
        elif a3[i] == b[j]:
            a3[i] = 1
 
print(line1)
print(line2)
print(line3)

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