Harryxun/stf_run huggingface dataset:
import collections
def main():
    li = list(map(int,input().split()))
    respondents = [int(input()) for i in range(li[2])]
    number_of_respondes = respondes_number_of_participants(respondents)
    check_surviver(number_of_respondes,li[0],li[1],li[2])


def respondes_number_of_participants(respondents):
    return collections.Counter(respondents)


def check_surviver(number_of_respondes,number_of_participants,gived_points,number_of_questions):
    for i in range(number_of_participants):
        if number_of_respondes[i+1]:
            if gived_points - number_of_questions + number_of_respondes[i+1] > 0:
                print("Yes")
            else:
                print("No")
        else:
            if gived_points - number_of_questions > 0:
                print("Yes")
            else:
                print("No")

if __name__ == "__main__":
    main()


### FIXED CODE ###

S = input()

if S == "Sunny":
    print("Cloudy")
elif S == "Rainy":
    print("Sunny")
else:
    print("Rainy")
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
time=0
menu=[A,B,C,D,E]
count=0
order=[]
kauri=[]
for i in range(5):
  if menu[i]%10==0:
      order.append(menu[i])
      count+=1
for h in range(9):
  for g in range(5):
    if menu[g]%10==9-h:
      kauri.append(menu[g])
      order.append(menu[g]+(h+1))
order[4]=kauri[4-count]      
print(sum(order))

### FIXED CODE ###

A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
time=0
menu=[A,B,C,D,E]
count=0
order=[]
kauri=[]
for i in range(5):
  if menu[i]%10==0:
      order.append(menu[i])
      count+=1
for h in range(9):
  for g in range(5):
    if menu[g]%10==9-h:
      kauri.append(menu[g])
      order.append(menu[g]+(h+1))
if  count!=5:
  order[4]=kauri[4-count]      
print(sum(order))
mod = 1000000000 + 7
 
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])
    if temp != 1:
        arr.append([temp, 1])
    if arr == []:
        arr.append([n, 1])
    return arr
 
n = int(input())
dat = [0] * 2000 # 約数として求められたある数の合計
 
# N! の各要素の素因数分解をする
res = 1
for i in range(1, n + 1):
    d = factorization(i)
    for j in range(len(d)):
        dat[d[j][0]] += d[j][1]
 
for i in range(2, n + 1):
    res *= (dat[i] + 1)
    res %= mod
 
print(res)

### FIXED CODE ###

a,b,c,d = map(int, input().split())
if a*b > c*d:
    print(a*b)
else:
    print(c*d)
S = input()
if S = ABC:
  print("ARC")
elif S = ARC:
  print("ABC")
else:

### FIXED CODE ###

S = input()
if S == "ABC":
  print("ARC")
else:
  print("ABC")
s = input()
t = input()
if t in s:
    print(0)
else:
    ans = len(t)
    for i in range(len(t)):
        for j in range(len(s)):
            if t[i] == s[j]:
                if ((len(t) - i) <= (len(s) - j)) and i <= j:
                    k = i + 1
                    l = j + 1
                    cnt1 = 0
                    while k < len(t):
                        if t[k] != s[l]:
                            cnt1 += 1
                        k += 1
                        l += 1
                    k = i - 1
                    l = j - 1
                    cnt2 = 0
                    while k >= 0:
                        if t[k] != s[l]:
                            cnt2 += 1
                        k -= 1
                        l -= 1
                    ans = min(ans, cnt1 + cnt2)  
                else:
                  if (len(t) - i) > (len(s) - j)):
                    break
               
    print(ans)


### FIXED CODE ###

s = input()
t = input()
if t in s:
    print(0)
else:
    ans = len(t)
    for i in range(len(s) - len(t) + 1):
        cnt = 0
        k = i
        l = 0
        while l < len(t) and k < len(s):
            if s[k] != t[l]:
                cnt += 1 
            k += 1
            l += 1    
        ans = min(ans, cnt)
    print(ans)
import sys
sys.setrecursionlimit(10 ** 8)

nil = -1

class Node:
    def __init__(self, p, l, r):
        self.p = p
        self.l = l
        self.r = r

def depth_rec(u, p, depth):
    depth[u] = p
    if tree[u].r != nil:
        depth_rec(tree[u].r, p, depth)
    if tree[u].l != nil:
        depth_rec(tree[u].l, p + 1, depth)
    pass

n = int(sys.stdin.readline())

tree = [Node(nil, nil, nil) for i in range(n)]
depth = [0] * n

for i in range(n):
    line = [int(i) for i in sys.stdin.readline().split()]
    vertex = line[0]

    for (j, c) in enumerate(line[2:]):
        if j == 0:
            tree[vertex].l = c
        else:
            tree[l].r = c

        l = c
        tree[c].p = vertex

'''
for i in range(n):
    print(tree[i].p, tree[i].l, tree[i].r)
'''
for i in range(n):
    if tree[i].p == nil:
        root = i

depth_rec(root, 0, depth)

# print(depth)

for vtx in range(n):
    print("node {}: parent = {}, depth = {}, ".format(vtx, tree[vtx].p, depth[vtx]), end = "")

    if tree[vtx].p == nil:
        print("root, ", end = "")
    elif tree[vtx].l == nil:
        print("leaf, ", end = "")
    else:
        print("internal node, ", end = "")

    children = []
    child = tree[vtx].l

    while child != nil:
        children.append(child)
        child = tree[child].r

    print(children)

### FIXED CODE ###

import sys

nil = -1

def set_depth(v, depth):
    tree[v][2] = depth

    for child in tree[v][1]:
        set_depth(child, depth + 1)

n = int(input())

tree = [[nil, [], 0, 'leaf'] for i in range(n)]

for i in range(n):
    line = [int(i) for i in sys.stdin.readline().split()]
    t_id = line[0]
    children = line[2:]

    tree[t_id][1] = children

    if children:
        tree[t_id][3] = 'internal node'

    for child in children:
        tree[child][0] = t_id

for t_id in range(n):
    if tree[t_id][0] == nil:
        tree[t_id][3] = 'root'
        r = t_id
        break

# print(tree)

set_depth(r, 0)

for t_id in range(n):
    parent = tree[t_id][0]
    depth = tree[t_id][2]
    children = tree[t_id][1]
    type_t = tree[t_id][3]

    print('node {}: parent = {}, depth = {}, {}, {}'.format(
            t_id, parent, depth, type_t, children))
S = input()
ans = 0
for i in range(len(S)):
	if S[i] == "+":
        ans += 1
    else:
      	ans -= 1
print(ans)


### FIXED CODE ###

S = input()
ans = 0
for i in range(len(S)):
	if S[i] == "+":
		ans += 1
	else:
		ans -= 1
print(ans)
import sys
from decimal import Decimal

def main():

    input_strings = sys.stdin.readlines()
    for coef_and_cons in input_strings:
        a, b, c, d ,e, f = map(Decimal, coef_and_cons.split())
        x = (f/e - c/b) / (d/e - a/b)
        y = (f/d - c/a) / (e/d - b/a)
        print('%.3f %.3f' %  (x.quantize(Decimal('0.001'), rounding='ROUND_HALF_DOWN'),
                              y.quantize(Decimal('0.001'), rounding='ROUND_HALF_DOWN') )
             )


main()

### FIXED CODE ###

import sys
from decimal import Decimal
from fractions import Fraction

def main():

    input_strings = sys.stdin.readlines()
    for matrix_string in input_strings:
        matrix = list(map(Fraction, list(matrix_string.split())))
        if matrix[0] == 0:
            matrix = matrix[3:] + matrix[:3]
        matrix = list(map(lambda x: x / matrix[0], matrix[:3])) + matrix[3:]
        matrix = matrix[:3] + list(map(lambda x: x[1] - matrix[3] * x[0], zip(matrix[:3], matrix[3:])))
        matrix = matrix[:3] + list(map(lambda x: x / matrix[4], matrix[3:]))
        matrix = list(map(lambda x: x[0] - matrix[1] * x[1], zip(matrix[:3], matrix[3:]))) + matrix[3:]
        matrix = list(map(float, matrix))
        matrix = list(map(Decimal, matrix))
        matrix = list(map(lambda x: x.quantize(Decimal('.001'), rounding='ROUND_HALF_UP'), matrix))

        print('%.3f %.3f' % (matrix[2], matrix[5]))
main()
K = int(input())
A,B =list(map(int,input().split()))
count =0
while count * K<A:
	count +=1
if count *K <=B:
	print("OK")
else
	print("NG")

### FIXED CODE ###

K = int(input())
A,B =list(map(int,input().split()))
count =0
while count * K<A:
	count +=1
if count *K <=B:
	print("OK")
else:
	print("NG")
i = list(map(int, input().split()))
j = list(map(int, input().split()))
if i[0]<=sum(j):
	print(Yes)
else:
	print(No)

### FIXED CODE ###

i = list(map(int, input().split()))
j = list(map(int, input().split()))
if i[0]<=sum(j):
  print("Yes")
else:
  print("No")
import sys
sys.setrecursionlimit(100030)
N=int(input())
a=[-1]+[int(input())-1 for i in range(1,N)]
G=[[] for i in range(N)]
for i in range(1,N):
    G[a[i]].append(i)
def dp(i):
    if len(G[i])==0:
        return 0
    X=sorted([dp(j) for j in G[i]],reverse=True)
    K=len(X)
    Y=[X[i]+i+1 for i in range(K)]
    return max(Y)
print(dp(0))


### FIXED CODE ###

import sys
import heapq
sys.setrecursionlimit(2*10**5)
N=int(input())
a=[-1]+[int(input())-1 for i in range(1,N)]
G=[[] for i in range(N)]
for i in range(1,N):
    G[a[i]].append(i)
def dp(i):
    if len(G[i])==0:
        return 0
    q=[]
    for j in G[i]:
        heapq.heappush(q,-dp(j))
    k=1
    res=0
    while(q):
        x=-heapq.heappop(q)
        res=max(res,x+k)
        k+=1
    return res
print(dp(0))
while 1:
   H, W = map(int, raw_input().split())
    
   if H == 0 and W == 0:
      break
   for i in range(H):
      if H%2 ==0:
         if W%2 == 1:
            print ".#"*(w/2)+"."
         elif W%2 == 0:
            print ".#"*(W/2)
   elif H%2 == 1:
         if W%2 == 1:
            print "#."*(w/2)+"#"
         elif W%2 == 0:
            print "#."*(W/2)
   print""

### FIXED CODE ###

while 1:
   H, W = map(int, raw_input().split())
           
   if H == 0 and W == 0:
      break
   for i in range(H):
      if i%2 == 0:
         if W%2 == 0:
            print "#."*(W/2)
         elif W%2 == 1:
            print "#."*(W/2)+"#"
      elif i%2 == 1:
         if W%2 == 0:
            print ".#"*(W/2)
         elif W%2 == 1:
            print ".#"*(W/2)+"."
   print ""
from fractions import gcd
import math
import numpy as np
N = list(map(int, input().split()))
g = gcd(N[0], N[1])
max_prime = int(np.sqrt(g))+1
primes = np.ones(g + 1)
#print(g+1, primes.shape)
primes[0:2] = 0
#print(primes)
for i in range(2, max_prime):
  if i * 2 < g + 1:
    primes[i*2::i] = 0
    #print(i, primes)

primes = primes.nonzero()[0]
#print(primes.nonzero()[0])

factor = primes[g % primes == 0]

#print(g, original_g, factor)
print(len(factor) + 1)

### FIXED CODE ###

from fractions import gcd
import math
import numpy as np
N = list(map(int, input().split()))
g = gcd(N[0], N[1])

def factorize(g):
  factor = []
  for i in range(2, int(np.sqrt(g))+2):
    if g % i != 0:
      continue
    while g % i == 0:
      g //= i
    factor.append(i)
  if g != 1:
    factor.append(g)
  return factor
print(len(factorize(g))+1)
N=int(input())
inp=[]

for i in range(N):
    inp.append(int(input()))

c0=N.count("AC")
c1=N.count("WA")
c2=N.count("TLE")
c3=N.count("RE")

print("AC x "+str(c0))
print("WA x "+str(c1))
print("TLE x "+str(c2))
print("RE x "+str(c3))

### FIXED CODE ###

N=int(input())
inp=[]

for i in range(N):
    inp.append((input()))

c0=inp.count("AC")
c1=inp.count("WA")
c2=inp.count("TLE")
c3=inp.count("RE")

print("AC x "+str(c0))
print("WA x "+str(c1))
print("TLE x "+str(c2))
print("RE x "+str(c3))
A , B = map(int,input().split())
if A => 13:
  print(B)
elif 6 =< A => 12:
  print(B / 2)
else:
  print(0)

### FIXED CODE ###

A , B = map(int,input().split())
if A >= 13:
    print(B)
elif 6 <= A <= 12:
    print(int(B / 2))
else:
    print(0)
def my_index(l, x):
    return [i for i, _x in enumerate(l) if _x == x]

H,W,M=map(int,input().split())
P=list()
P_X=[0]*(H+1)
P_Y=[0]*(W+1)
for m  in range(M):
    P.append(list(map(int,input().split())))
    P_X[P[m][0]]+=1
    P_Y[P[m][1]]+=1
Max_X=max(P_X)
Max_Y=max(P_Y)
m_count=0
for k in P:
    if  P_X[k[0]] == Max_X and P_Y[k [1]] == Max_Y:
        m_count += 1
if m_count==len(max_X)*len(max_Y):
    answer=Max_X+Max_Y-1
else:
     answer=Max_X+Max_Y
    
print(answer)


### FIXED CODE ###


def my_index(l, x):
    return [i for i, _x in enumerate(l) if _x == x]

H,W,M=map(int,input().split())
P=list()
P_X=[0]*(H+1)
P_Y=[0]*(W+1)
for m  in range(M):
    P.append(list(map(int,input().split())))
    P_X[P[m][0]]+=1
    P_Y[P[m][1]]+=1
Max_X=max(P_X)
Max_Y=max(P_Y)
max_X=my_index(P_X,Max_X)
max_Y=my_index(P_Y,Max_Y)
m_count=0
for k in P:
    if  P_X[k[0]] == Max_X and P_Y[k [1]] == Max_Y:
        m_count += 1
if m_count==len(max_X)*len(max_Y):
    answer=Max_X+Max_Y-1
else:
     answer=Max_X+Max_Y
    
print(answer)
a=input()
if a[-1]==s:
  print(a+'es')
else:
  print(a+'s')

### FIXED CODE ###

n=input()
if n[-1]=='s':
    print(n+'es')
else :
    print(n+'s')
a,b,c,d=map(int,input().split())
while True:
    c-=b
    if c<=0:
		print('Yes')
		break
    a-=d
    if a<=0:
		print('No')
		break

### FIXED CODE ###

a,b,c,d=map(int,input().split())
x=(a+d-1)//d
y=(c+b-1)//b
if x>=y:
    print('Yes')
else:
    print('No')
import numpy as np
N, W = map(int, input().split())
dp = np.zeros((N, W+1), dtype = "int64")
for i in range(N):
    w, v = map(int, input().split())
    dp[i,-w:] = dp[i-1, -w:] #残りの重さW-w以上にするためには、荷物を入れられない。
    dp[i, :W-w+1] = np.fmax(dp[i-1, :W-w+1], dp[i-1, w:]+v)
print(dp[N-1, 0])

### FIXED CODE ###

import numpy
N, W = map(int, input().split())
memo = numpy.array([[10**9+1 for i in range(10**5+1)] for j in range(N)])
memo[-1][0] = 0
for n in range(N):
    w, v = map(int, input().split())
    memo[n][:v] = memo[n-1][:v]
    memo[n][v:] = numpy.fmin(memo[n-1][v:], memo[n-1][:-v]+w)
a = numpy.where(memo[-1] <= W)
print(numpy.max(a[0]))
n.i=map(int,input().split())
print(n-i+1)

### FIXED CODE ###

n,i=map(int,input().split())
print(n-i+1)
n,m = map(int,input().split())
print(t+s)

### FIXED CODE ###

s,t = input().split()
print(t+s)
"""
https://atcoder.jp/contests/tokiomarine2020/submissions/14229099
"""
N,K = map(int,input().split())
A = list(map(int,input().split()))
 
def update(A):
    b = [0]*N
    for i,a in enumerate(A):
        l = max(0,i-a)
        r = min(N-1,i+a)
        b[l] += 1
        if r+1 < N:
            b[r+1] -= 1
    res = []
    s = 0
    for i in b:
        s += i
        res.append(s)
    return res
 
for _ in range(min(K,30)):
    A = update(A)
 
print(*A)

### FIXED CODE ###

S = input()
print(S[:3])
a=input()
b=input()
c=input()
 
if a == b:
  print(int(c))
elif a == c:
  print(int(b))
elif b == c:
  print(int(a))

### FIXED CODE ###

a,b,c=map(int,input().split())
if a==b:
    print(c)
elif b==c:
  print(a)
else:
  print(b)
#Thank you for snuke!

N,M = map(int,input().split())
key = []
for i in range(M) :
    a,b = map(int,input().split())
    s = 0
    cx = list(map(int,input().split()))
    for j in range(b) :
        s = s | (1 << (cx[j]-1))
    key.append([s,a])

dp = [10**9 for i in range(1 << N)]
dp[0] = 0
for s in range(1 << N) :
    for i in range(N) :
        t = s | key[i][0]
        cost = dp[s] + key[i][1]
        dp[t] = min(dp[t], cost)

ans = dp[-1] if dp[-1] != 10**9 else -1

print(ans)


### FIXED CODE ###

#Thanks, snuke!

N,M = map(int,input().split())
key = []
for i in range(M) :
    a,b = map(int,input().split())
    s = 0
    cx = list(map(int,input().split()))
    for j in range(b) :
        s = s | (1 << (cx[j]-1))
    key.append([s,a])

dp = [10**12 for i in range(1 << N)]
dp[0] = 0
for s in range(1 << N) :
    for i in range(M) :
        t = s | key[i][0]
        cost = dp[s] + key[i][1]
        dp[t] = min(dp[t], cost)

ans = dp[-1] if dp[-1] != 10**12 else -1

print(ans)
X = int(input())

ans = 10**9

def func(current, t):
    global ans
    if ans < t or current > X:
        return
    if current == X :
        ans = min([ans, t])
        return

    func(current+(t+1), t+1)
    func(current-(t+1), t+1)
    func(current, t+1)

func(0, 0)

print(ans)


### FIXED CODE ###

X = int(input())

t = 0
i = 1
while True:
    t += i
    if t >= X:
        print(i)
        break
    else:
        i += 1
from math import factorial

mod = 10**9 + 7

# 組み合わせ　n_C_r
def comb(n,r):
    r = min(r,n-r)
    return factorial(n) // (factorial(n-r)*factorial(r))

N,K = map(int,input().split())

def cal(i):
    return comb(K-1,i-1) * comb(N-K+1,i) % mod

for i in range(1,K+1):
    ans = cal(i)
    print(ans)

### FIXED CODE ###

from math import factorial

mod = 10**9 + 7

# 組み合わせ　n_C_r
def comb(n,r):
    if not n >= r:
        return 0
    return factorial(n) // (factorial(n-r)*factorial(r))

N,K = map(int,input().split())

def cal(i):
    return comb(K-1,i-1) * comb(N-K+1,i) % mod

for i in range(1,K+1):
    ans = cal(i)
    print(ans)
x, y =  map(int ,int)
z = 0
i = 1
a = 0

while z < 10 ** 18 or a =  0:
    z = x * i
    i = i + 1
    if z mod y != 0:
        a = 1



### FIXED CODE ###

x, y =  map(int, input().split())
i = 1
if x % y == 0:
    print(-1)
else:
    for i in range(10 ** 18 + 1):
        if (i * x) % y != 0:
            print(i * x)
            break
        else:
            continue
A= int(input())
B = int(input())

print(A*B)

### FIXED CODE ###

a,b=map(int,input().split())
print(a*b)
# -*- coding: utf-8 -*-
n, m = [int(x) for x in input().split()]
adj = [[0]*m for i in range(m)]
visited = [0]*m
for i in range(m):
    a, b = [int(x) for x in input().split()]
    adj[a-1][b-1] = 1
    adj[b-1][a-1] = 1

ans = 0
def dfs(v):
    global ans
    if sum(visited) == m:
        ans += 1
    for i in range(m):
        if adj[v-1][i] == 1 and visited[i] == 0:
            visited[i] = 1
            dfs(i+1)
            visited[i] = 0

visited[0] = 1
dfs(1)
print(ans)

### FIXED CODE ###

# -*- coding: utf-8 -*-
n, m = [int(x) for x in input().split()]
adj = [[0]*n for i in range(n)]
visited = [0]*n
for i in range(m):
    a, b = [int(x) for x in input().split()]
    adj[a-1][b-1] = 1
    adj[b-1][a-1] = 1

ans = 0
def dfs(v):
    global ans
    if sum(visited) == n:
        ans += 1
    for i in range(n):
        if adj[v-1][i] == 1 and visited[i] == 0:
            visited[i] = 1
            dfs(i+1)
            visited[i] = 0

visited[0] = 1
dfs(1)
print(ans)
N=int(input())
list=[]
for i in N:
  list.append(input())
  
print(len(list))  

### FIXED CODE ###

n=int(input())
s=[]
for i in range(n):
  s.append(input())
  
print(len(set(s)))
s=input()
print(len(s))
for i in range(len(s)):
    if s[i]=="h":
        if i<len(s)-1:
            if s[i+1]=="i":
                print("Yes")
                break
	print("No")


### FIXED CODE ###

s=input()
a=len(s)//2
if len(s)%2==1:
    print("No")
else:
    if s=="hi"*a:
        print("Yes")
    else:
        print("No")
def fizz_buzz():
    c = 1
    while True:
        res = ''
        if c % 3 == 0:
            res = res + 'Fizz'
        if c % 5 == 0:
            res = res + 'Buzz'
        if res == '':
            yield str(c)
        else:
            yield res
        c += 1

while True:
    m,n = map(int,raw_input().split())
    if m == 0: break

    player = range(m)

    p = 0
    fb = fizz_buzz()
    for i in range(n):
        inp = raw_input()
        if len(player) > 1:
            if  inp <> fb.next():
                del player[p] 
            else:
                p = (p+1) % len(player)

    result = str(player[0]+1)
    for pi in player[1:]:
        result += ' ' + str(pi+1)

    print result

### FIXED CODE ###

def fizz_buzz():
    c = 1
    while True:
        res = ''
        if c % 3 == 0:
            res = res + 'Fizz'
        if c % 5 == 0:
            res = res + 'Buzz'
        if res == '':
            yield str(c)
        else:
            yield res
        c += 1

while True:
    m,n = map(int,input().split())
    if m == 0: break

    player = list(range(m))

    p = 0
    fb = fizz_buzz()
    for i in range(n):
        inp = input()
        if len(player) > 1:
            if  inp != next(fb):
                del player[p] 
                p = p % len(player)
            else:
                p = (p+1) % len(player)

    result = str(player[0]+1)
    if len(player) > 1:
        for pi in player[1:]:
            result += ' ' + str(pi+1)

    print(result)
a = [list(map(int, input().split())) for _ in range(3)]
n = int(input())
b = [int(input()) for _ in range(n)]
 
for num in b:
  for x in range(3):
    for y in range(3):
      if a[x][y] == num:
        a[x][y] = 0
 
if sum(a[0]) == 0 or sum(a[1]) == 0 or sum(a[2]) == 0:
  print("Yes")
elif sum([a[0][0],a[1][1],a[2][2]]) == 0 or sum([a[2][0],a[1][1],a[0][2]]) == 0:
  print("Yes")
elif sum([a[0][0],a[1][0],a[2][0]]) == 0 or sum([a[0][1],a[1][1],a[2][1]]) == 0 or sum([a[0][2],a[1][2],a[2][2]]) == 0:
  print("Yes")                                                 
else:
  print("No")
a = [list(map(int, input().split())) for _ in range(3)]
n = int(input())
b = [int(input()) for _ in range(n)]

for num in b:
  for x in range(3):
    for y in range(3):
      if a[x][y] == num:
        a[x][y] = 0

if sum(a[0]) == 0 or sum(a[1]) == 0 or sum(a[2]) == 0:
  print("Yes")
elif sum([a[0][0],a[1][1],a[2][2]]) == 0 or sum([a[2][0],a[1][1],a[0][2]]) == 0:
  print("Yes")
elif sum([a[0][0],a[1][0],a[2][0]]) == 0 or sum([a[0][1],a[1][1],a[2][1]]) == 0 or sum([a[0][2],a[1][2],a[2][2]]) == 0:
  print("Yes")                                                 
else:
  print("No")

### FIXED CODE ###

a = [list(map(int, input().split())) for _ in range(3)]
n = int(input())
b = [int(input()) for _ in range(n)]
 
for num in b:
  for x in range(3):
    for y in range(3):
      if a[x][y] == num:
        a[x][y] = 0
 
if sum(a[0]) == 0 or sum(a[1]) == 0 or sum(a[2]) == 0:
  print("Yes")
elif sum([a[0][0],a[1][1],a[2][2]]) == 0 or sum([a[2][0],a[1][1],a[0][2]]) == 0:
  print("Yes")
elif sum([a[0][0],a[1][0],a[2][0]]) == 0 or sum([a[0][1],a[1][1],a[2][1]]) == 0 or sum([a[0][2],a[1][2],a[2][2]]) == 0:
  print("Yes")                                                 
else:
  print("No")
W,H,x,y,r = map(int,input().split(" "))
if x - r >= 0 and x + r <= W:
    if y - r >= 0 and y + r <= H:
        print "Yes"
    else:
        print "No"
else:
    print"No"

### FIXED CODE ###

W,H,x,y,r = map(int,input().split(" "))
if x - r >= 0 and x + r <= W:
    if y - r >= 0 and y + r <= H:
        print("Yes")
    else:
        print("No")
else:
    print("No")
n= int(input())
spot = input().split()
ans = []
for i in spot:
    spot.append(int(spot[0]))
    del spot[0]
if n == 1:
    print(0)
else:
    if max(spot)==1:
        ans.sppend(0)
    for s in range(min(spot),max(spot)):
        x = 0
        for t in spot:
            x += (s-t)**2
        ans.append(x)
if n != 1:
    ans.sort(reverse=True)
    print(ans[0])

### FIXED CODE ###

n= int(input())
spot = input().split()
ans = []
for i in spot:
    spot.append(int(spot[0]))
    del spot[0]
if n == 1:
    print(0)
else:
    if max(spot)==min(spot):
        ans.append(0)
    for s in range(min(spot),max(spot)):
        x = 0
        for t in spot:
            x += (s-t)**2
        ans.append(x)
if n != 1:
    ans.sort(reverse=False)
    print(ans[0])
def main():
	N = int(input())
	A = list(map(int, input().split()))
	while(len(A) != 1):
		A = QUICKSORT(A)
		mini = A[0]
		for i in range(1, len(A)):
			if i >= len(A):
				continue
			if A[i] % mini == 0:
				A.pop(i)
			else:
				A[i] = A[i] % mini
		A = QUICKSORT(A)
		piv = A[0]
		for i in range(1, len(A)):
			if i >= len(A):
				continue
			if A[i] == piv:
				A.pop(i)
	print(A[0])

def QUICKSORT(A):
	if len(A) < 1:
		return A
	pivot = A[0]
	left = []
	right = []
	for x in range(1, len(A)):
		if A[x] <= pivot:
			left.append(A[x])
		else:
			right.append(A[x])
	left = QUICKSORT(left)
	right = QUICKSORT(right)
	foo = [pivot]
	return left + foo + right

if __name__ == '__main__':
	main()

### FIXED CODE ###

def main():
	N = int(input())
	A = list(map(int, input().split()))
	while(len(A) != 1):
		A.sort()
		mini = A[0]
		i = 1
		while(True):
			if A[i] % mini == 0:
				A.pop(i)
			else:
				A[i] = A[i] % mini
				i += 1
			if i == len(A):
				break
		A = list(set(A))
	print(A[0])

if __name__ == '__main__':
	main()