Harryxun/stf_run huggingface dataset:
N = 0
numbers = array()

N = int(input())
numbers = input().split()
numbers = [1/int(i) for i in numbers]

print(1/sum(numbers))


### FIXED CODE ###

N = 0
numbers = []

N = int(input())
numbers = [1/int(i) for i in input().split()]

print(1/sum(numbers))
buf = input().split()
th = int(buf[0])
ts = int(buf[1])
ah = int(buf[2])
as = int(buf[3])

while True:
  ah -= ts
  if ah <= 0:
    break
  th -= as
  if th <= 0:
    break

if ah <= 0:
  print('Yes')
if th <= 0:
  print('No')

### FIXED CODE ###

buf = input().split()
th = int(buf[0])
ts = int(buf[1])
ah = int(buf[2])
ass = int(buf[3])

while True:
  ah -= ts
  if ah <= 0:
    break
  th -= ass
  if th <= 0:
    break

if ah <= 0:
  print('Yes')
if th <= 0:
  print('No')
import heapq

n, m = map(int, input().split())
goods = map(lambda x: int(x) * -1, input().split())
heapq.heapify(goods)
for i in range(m):
    the_most_expensive = heapq.heappop(goods)
    heapq.heappush(the_most_expensive / 2)

print(sum(goods) * -1)

### FIXED CODE ###

import heapq
import math

n, m = map(int, input().split())
goods = list(map(lambda x: int(x) * -1, input().split()))
heapq.heapify(goods)
for i in range(m):
    the_most_expensive = heapq.heappop(goods)
    heapq.heappush(goods, math.ceil(the_most_expensive / 2))

print(sum(goods) * -1)
K,S=map(int,input().split())
conut=0
for x in range(K+1):
    for y in range(K+1):
        for z in range(K+1):
            if x+y+z==S:
                count+=1
print(count)

### FIXED CODE ###

K,S=map(int,input().split())
count=0
for x in range(K+1):
    for y in range(K+1):
        sumz=S-x-y
        if sumz>=0 and sumz<=K:    
            count+=1
print(count)
n , m = map(int, input().split())
a = list(map(int,input().split()))

def gcd(num1,num2):
    r=1
    while r>0:
        r=num1%num2
        num1=num2
        num2=r
    return num1

def lcm(num1,num2):
    gcd1=gcd(num1,num2)
    return num1*num2//gcd1

lcm1=a[0]//2
lcm2=a[0]

for i in range(1,n):
    t=a[i]
    ta=max(t//2,lcm1)
    tb=min(t//2,lcm1)
    if ta!=tb and ta//tb%2==0:
        lcm1=0
        lcm2=0
    lcm1=lcm(lcm1,t//2)
    lcm2=lcm(lcm2,t)


if lcm1!=0:
    ans1=m//lcm1
    ans2=m//lcm2
    ans=ans1-ans2
else:
    ans=0

print(ans)


### FIXED CODE ###

n , m = map(int, input().split())
a = list(map(int,input().split()))

def gcd(num1,num2):
    r=1
    while r>0:
        r=num1%num2
        num1=num2
        num2=r
    return num1

def lcm(num1,num2):
    gcd1=gcd(num1,num2)
    return num1*num2//gcd1

lcm1=a[0]//2
lcm2=a[0]

for i in range(1,n):
    t=a[i]
    lcm1=lcm(lcm1,t//2)
    lcm2=lcm(lcm2,t)
    ta=max(t//2,lcm1)
    tb=min(t//2,lcm1)
    if ta!=tb and ta//tb%2==0:
        lcm1=0
        lcm2=0
        break

if lcm1!=0:
    ans1=m//lcm1
    ans2=m//lcm2
    ans=ans1-ans2
else:
    ans=0

print(ans)
import math
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
n=int(input())
ans=1
tmp1=int(input())
for i in range(n-1):
    tmp2=int(input())
    ans=lcm(tmp1,tmp2)
    tmp1=ans
print(ans)

### FIXED CODE ###

def gcd(x, y):
    if y == 0:
        return x
    else:
        return gcd(y, x%y)
def lcm(x, y):
    return (x * y) // gcd(x, y)
n=int(input())
tmp1=int(input())
ans=tmp1
for i in range(n-1):
    tmp2=int(input())
    ans=lcm(tmp1,tmp2)
    tmp1=ans
print(ans)
N = int(input())
if  N == 7　or N == 5 or N == 3:
	print('YES')
else:
  	print('NO')

### FIXED CODE ###

N = int(input())
if  N == 7 or N == 5 or N == 3:
	print('YES')
else:
  	print('NO')
N = int(input())
if N==1:
    print("Hello World")
else:
    A, B = [int(x) for x in input().split()]
    print(int(A+B))

### FIXED CODE ###

N = int(input())
if N==1:
    print("Hello World")
else:
    A = int(input())
    B = int(input())
    print(A+B)
AB,BC,CA = map(int, input().split("|  |"))
print(AB*BC/2)


### FIXED CODE ###

AB,BC,CA = map(int, input().split(" "))
print(int(AB*BC/2))
N,M=map(int,input().split())
mod = 10**9+7
def framod(n, mod, a=1):
    for i in range(1,n+1):
        a=a * i % mod
    return a

def power(n, r, mod):
    if r == 0: return 1
    if r%2 == 0:
        return power(n*n % mod, r//2, mod) % mod
    if r%2 == 1:
        return n * power(n, r-1, mod) % mod

def comb(n, k, mod):
    a=framod(n, mod)
    b=framod(k, mod)
    c=framod(n-k, mod)
    return (a * power(b, mod-2, mod) * power(c, mod-2, mod)) % mod

def cnt(n):
  s = sum([comb(n-i,i,mod)%mod for i in range(n//2+1)]:
  s = s%mod
  return s

A0 = 0
ans = 1
for i in range(M):
  A1 = int(input()) - 1
  ans = (ans * cnt(A1-A0))%mod
  A0 = A1+2
ans = (ans * cnt(N-A0))%mod
print(ans)


### FIXED CODE ###

N,M=map(int,input().split())
mod = 10**9+7
fram = [1]
for i in range(1,N+1):
  fram.append(fram[-1]*i%mod)

#def framod(n, mod, a=1):
#    for i in range(1,n+1):
#        a = a * i % mod
#    return a

def power(n, r, mod):
    if r == 0: return 1
    if r%2 == 0:
        return power(n*n % mod, r//2, mod) % mod
    if r%2 == 1:
        return n * power(n, r-1, mod) % mod

def comb(n, k, mod):
    a=fram[n]
    b=fram[k]
    c=fram[n-k]
    return (a * power(b, mod-2, mod) * power(c, mod-2, mod)) % mod

def cnt(n):
  s = sum([comb(n-i,i,mod)%mod for i in range(n//2+1)])
  s = s%mod
  return s

A0 = 0
ans = 1
for i in range(M):
  A1 = int(input()) - 1
  ans = (ans * cnt(A1-A0))%mod
  A0 = A1+2
ans = (ans * cnt(N-A0))%mod
print(ans)
import math

A, B, H, M = map(int, input().split())

KA = H / 12 * 360 + ((M / 60) * (360 / 12))
KB = M / 60 * 360

K = abs(KA - KB)
if K > 180:
    K = 360 - K
# if K == 180:
#     print(A + B)
#     exit()
# if K == 0:
#     print(abs(B - A))
#     exit()
# cosB = round(math.cos(math.radians(K)), 13)
cosB = math.cos(math.radians(K)), 13
cc = A ** 2 + B ** 2 - (2 * B * A * cosB)
print(math.sqrt(cc))


### FIXED CODE ###

import math

a, b, h, m = map(int, input().split())

if h * 360 / 12 + m * 360 / 60 / 12 > m * 360 / 60:
    r = (h * 360 / 12 + m * 360 / 60 / 12) - m * 360 / 60
else:
    r = m * 360 / 60 - (h * 360 / 12 + m * 360 / 60 / 12)

if r > 180:
    r = 360 - r

# if r == 90:
#     t = a ** 2 + b ** 2
#     print(math.sqrt(t))
# else:
c = a ** 2 + b ** 2 - 2 * a * b * math.cos(math.radians(r))
print(math.sqrt(c))
#「辺」彩色
#最大次数で可
#構成はset()使って色管理
#Adいらない
n = int(input())
#Ad = [set() for i in range(n)]
Deg = [0]*n
E = []
for i in range(n-1):
    ai,bi = map(int, input().split( ))
    ai-=1
    bi-=1
    #Ad[ai].add(bi)
    #Ad[bi].add(ai)
    Deg[ai]+=1
    Deg[bi]+=1
    E.append((ai,bi))

cl = max(Deg)
Deg2 = [set(range(cl)) for i in range(n)]
print(cl)
for ai,bi in E:
    #"c = 0
    #while c  not in Deg2[ai] or c not in Deg2[bi]:
    #    #c+=1ここで色探すのが遅かった
    
    for c in Deg2[ai]:
        if c in Deg2[bi]:
            print(c+1)
            break
    Deg2[ai].remove(c)
    Deg2[bi].remove(c)
    


### FIXED CODE ###


n = int(input())
Ad = [[] for _ in range(n)]
Deg = [0]*n
E = {}
E2 =[]
for i in range(n-1):
    ai,bi = map(int, input().split( ))
    ai-=1
    bi-=1
    Ad[ai].append(bi)
    Ad[bi].append(ai)
    Deg[ai] += 1
    Deg[bi] += 1
    E[(ai,bi)]=-1
    E[(bi,ai)]=-1
    E2.append((ai,bi))
mx = max(Deg)
print(mx)
E[(0,0)] = -1#後の都合
P =[-1]*n#parent
from collections import deque
Q = deque()
Q.append(0)
P[0] = 0

while Q:
    v = Q.popleft()
    for u in Ad[v]:
        if P[u]<0:
            P[u] = v
            Q.append(u)

Q = deque()
cnt = 1
for v in Ad[0]:
    E[(0,v)]=cnt
    E[(v,0)]=cnt
    cnt+=1
    Q.append(v)

while Q:
    v = Q.popleft()
    cnt = 1
    for u in Ad[v]:
        if E[(u,v)]<0:
            if cnt==E[(v,P[v])]:
                cnt +=1
            E[(u,v)] = cnt
            E[(v,u)] = cnt
            cnt+=1
            Q.append(u)
for i in range(n-1):
    print(E[E2[i]])
T = input()
T = list(T)
que = T.count('?')

for i in range(que):
    a = T.index('?')
    if T[a - 1] == 'P':
        T[a] = 'D'
    elif T[a + 1] == 'D':
        T[a] = 'P'
    else:
        T[a] = 'D'
T = ''.join(T)
print(T)

### FIXED CODE ###

T = list(input())
for i in range(len(T)):
    if T[i] == '?':
        T[i] = 'D'
T = ''.join(T)
print(T)
import numpy


d = int(input())
c = numpy.array(list(map(int, input().split())))
s = []
for i in range(d):
    s.append(list(map(int, input().split())))

result = []
past = numpy.array([0] * 26)
ans = 0
for i in range(d):
    past += 1
    t = int(input())
    past[t-1] = 0
    ans += sum(past * -c) + s[i][t-1]
    print(ans)


### FIXED CODE ###

d = int(input())  # 365
c = list(map(int, input().split()))

# 最低限のポイントを確認？
for i in range(d):
    p = list(map(int, input().split()))
    print(p.index(max(p)) + 1)
import fractions 
n = int(input())
t = [int(input()) for i in range(n)]

def lcm(a, b):
  return (a * b) // fractions.gcd(a, b)

#入力tについて、最小公倍数を求めればそれが答えとなる
ans = lcm(t[0], t[1])
for i in range(2, n):
  ans = lcm(ans, t[i])

print(ans)

### FIXED CODE ###

import fractions 
n = int(input())
t = [int(input()) for i in range(n)]
def lcm(a, b):
  return (a * b) // fractions.gcd(a, b)

#入力tについて、最小公倍数を求めればそれが答えとなる
if n == 1:
  print(t[0])
else:
  ans = lcm(t[0], t[1])
  for i in range(2, n):
    ans = lcm(ans, t[i])
  print(ans)
n = int(input())
A = [int(input()) for i in range(n)]
B = [i % 2 for i in A]

print('first' if sum(B) % 2 != 0 or (any(b == 1 for b in B) and (max(A) - min(A)) <= 1) else 'second')

### FIXED CODE ###

from collections import defaultdict
from math import sqrt

n, p = [int(i) for i in input().split()]

A = defaultdict(int)

def factorize(n):    
    i = 2
    
    while n % i == 0:
        n //= i
        A[i] += 1
    i += 1

    while n != 1 and i <= sqrt(n):
        while n % i == 0:
            n //= i
            A[i] += 1
        i += 2
    if n != 1:
        A[n] += 1

    return A

factorize(p)
ans = 1
for k, v in A.items():
    if v >= n:
        ans *= k ** (v // n)

print(ans)
from sys import stdin

x = int(stdin.readline().rstrip())

fivelist = []

i = 0
while True:
    n = i**5
    #print(i,n)
    if n > (10**10):
        break
    fivelist.append(n)
    i+=1

for i in range(len(fivelist)):
    for j in range(len(fivelist)):
        if x == (fivelist[i] - fivelist[j]):
            a, b = i , j
            break
        if x == (-fivelist[i] - fivelist[j]):
            a, b = -i , j
            break
        if x == (fivelist[i] + fivelist[j]):
            a, b = i , -j
            break
        if x == (-fivelist[i] + fivelist[j]):
            a, b = -i , -j
            break

print("{} {}".format(a,b))


### FIXED CODE ###

from sys import stdin
import random

#a , b = 81,79
#x = a**5 - b**5
'''
while x < 1 or x > 10**9:
    a = random.randint(-100, 100)
    b = random.randint(-100, 100)
    x = a**5 - b**5
'''
#print(a,b,x)
x = int(stdin.readline().rstrip())

fivelist = []

i = 0
while True:
    n = i**5
    # print(i,n)
    if n > 2*(10**15):
        break
    fivelist.append(n)
    i += 1


a = 0
b = 0
ans = False
for i in range(len(fivelist)):
    for j in range(len(fivelist)):
        if x == (fivelist[i] - fivelist[j]):
            a, b = i, j
            ans = True
            break
        if x == (-fivelist[i] - fivelist[j]):
            a, b = -i, j
            ans = True
            break
        if x == (fivelist[i] + fivelist[j]):
            a, b = i, -j
            ans = True
            break
        if x == (-fivelist[i] + fivelist[j]):
            a, b = -i, -j
            ans = True
            break
    if ans:
        break

print("{} {}".format(a, b))
import math
n,k=map(int,input().split(" "))
a=list(map(int,input().split(" ")))
g=a[0]
m=max(a)
for i in range(n):
    g=math.gcd(g,a[i])
if k % g==0 and k<=m:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

### FIXED CODE ###

def gcd(a,b):
    if a==0: return b
    else: return gcd(b%a,a)

def main():
    n,k=map(int,input().split(" "))
    a=list(map(int,input().split(" ")))
    g=a[0]
    m=a[0]
    for e in a:
        g=gcd(g,e)
        if m<e: m=e
    if k % g==0 and k<=m:
        print("POSSIBLE")
    else:
        print("IMPOSSIBLE")

main()
rom collections import OrderedDict

cnt = OrderedDict()
for i in range(ord('a'), ord('z') + 1):
    cnt[chr(i)] = 0
s = input().lower()
for i in s:
    if i in cnt:
        cnt[i] += 1
for k, v in cnt.items():
    print('{}:{}'.format(k, v))

### FIXED CODE ###

from collections import OrderedDict
import sys

cnt = OrderedDict()
for i in range(ord('a'), ord('z') + 1):
    cnt[chr(i)] = 0

S = sys.stdin.readlines()
for s in S:
    s = s.lower()
    for i in s:
        if i in cnt:
            cnt[i] += 1

for k, v in cnt.items():
    print('{} : {}'.format(k, v))
import math
A,B,C,D = map(int,input().split())
lcm = C*D // math.gcd(C,D) 
print(B-A-int(B/C-A/C)-int(B/D-A/D)+int(B/lcm-A/lcm))

### FIXED CODE ###

def gcd(x,y):
  while y:
    x,y = y,x%y
  return x

def calc(x,a,b,l):
  return x - (x//a) - (x//b) + (x//l)

A,B,C,D = map(int,input().split())
lcm = C*D // gcd(C,D)
print(calc(B,C,D,lcm) - calc(A-1,C,D,lcm))
from collections import deque

dq = deque()
n = int(input())
for _ in range(n):
    cmd = input().split()
    if cmd[0] == "insert":
        dq.appendleft(cmd[1])
    elif cmd[0] == "delete":
        dq.remove(cmd[1])
    elif cmd[0] == "deleteFirst":
        dq.popleft()
    else:
        dq.pop()
print(*dq)

### FIXED CODE ###

from collections import deque

dq = deque()
n = int(input())
for _ in range(n):
    cmd = input().split()
    if cmd[0] == "insert":
        dq.appendleft(cmd[1])
    elif cmd[0] == "delete":
        try:
            dq.remove(cmd[1])
        except ValueError:
            pass
    elif cmd[0] == "deleteFirst":
        dq.popleft()
    else:
        dq.pop()
print(*dq)
N, L = map(int, input())
strings = [input() for _ in range(N)]
strings.sort()
print(''.join(strings))

### FIXED CODE ###

N, L = map(int, input().split())
strings = [input() for _ in range(N)]
strings.sort()
print(''.join(strings))
N = int(input())
B = list(map(int, input().split()))

SUM = 0
A = [0]*N

for i in range(N-1):
    if i == 0:
        A[i] = B[i]
        if B[i] > B[i+1]:
            A[i+1] = B[i+1]
        else:
            A[i+1] = B[i]
        continue
        
    if i < N-2:
        if B[i] > B[i+1]:
            A[i+1] = B[i+1]
        else:
            A[i+1] = B[i]
    else:
        A[i+1] = B[i]


print(sum(A))





### FIXED CODE ###

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

SUM = 0
A = [0]*N

for i in range(N-1):
    if i == 0:
        A[i] = B[i]

        if len(B) <= 1:
            A[i + 1] = B[i]
        else:
            if B[i] > B[i+1]:
                A[i+1] = B[i+1]
            else:
                A[i+1] = B[i]
        continue

    if i < N-2:
        if B[i] > B[i+1]:
            A[i+1] = B[i+1]
        else:
            A[i+1] = B[i]
    else:
        A[i+1] = B[i]

print(sum(A))
import numpy as np
try:   
    a,b,c,d,e,f = (int(i) for i in input().split())
    x,y = (np.dot(np.linalg.inv(np.array([[a,b],[d,e]])),np.array([c,f]))[0],np.dot(np.linalg.inv(np.array([[a,b],[d,e]])),np.array([3,6]))[1])
    print(x,y)
except EOFError:
    break

### FIXED CODE ###

while True:
    try:
        a,b,c,d,e,f = (int(i) for i in input().split())
        det=a*e-b*d
        x = (c*e-b*f)/det
        y = (a*f-c*d)/det
        if x==0:x=0
        if y==0:y=0
        print("{0:.3f} {1:.3f}".format(x,y))
    except EOFError:
        break
n=int(input())
l=[int(x) for x in input().split()]
l.sort()
s=0
for a in range(0,n-2):
    for b in range(a+1,n-1):
        c=b+1
        while l[c]<l[a]+l[b]:
            s=s+1
            b=b+1
print(s)

### FIXED CODE ###

def bis_right(lis,dev):
    a=0
    b=len(lis)-1
    while a<b:
        c=(a+b)//2
        if lis[c]>dev:
            b=c
        else:
            a=c+1
    if lis[a]<=dev:
        return a
    return a-1



n=int(input())
l=[int(x) for x in input().split()]
l.sort()
s=0
for a in range(n-2):
    for b in range(a+1,n-1):
        c=bis_right(l[b+1:],l[a]+l[b]-1)
        s+=c+1
print(s)
s = [input() for i in range(2)]
if (len(s[0]) > 10 or len(s[0]) < 1) or (len(s[0]) + 1 != len(s[1])):
    print("no")
else:
    for j in range(len(s)):
        if not s[0][j] == s[1][j]:
            print("no")
            break
    print("yes")

### FIXED CODE ###

flag = True
s = [input() for i in range(2)]
if (len(s[0]) > 10 or len(s[0]) < 1) or (len(s[0]) + 1 != len(s[1])):
    flag = False
else:
    for j in range(len(s[0])):
        if not s[0][j] == s[1][j]:
            flag = False
if flag:
    print("Yes")
else:
    print("No")
import sys
input = sys.stdin.readline
sys.setrecursionlimit(100000)
n, q = map(int, input().split())

trees = [[] for i in range(n)]
for i in range(n-1):
  a, b = map(int, input().split())
  trees[a-1].append(b-1)
  
values = [0 for i in range(n)]

for i in range(q):
  p, x = map(int, input().split())
  values[p-1] += x
  
def dfs(i):
  for j in trees[i]:
    values[j] += values[i]
    dfs(j)
    
dfs(0)
print(*values)

### FIXED CODE ###

n,q=map(int,input().split())
T=[[] for _ in range(n)]
for i in range(n-1):
    a,b=map(int,input().split())
    T[a-1].append(b-1)
    T[b-1].append(a-1)
C=[0]*n
for i in range(q):
    p,x=map(int,input().split())
    C[p-1]+=x
S=[0]
P=[0]*n
while S:
    s=S.pop()
    for t in T[s]:
        if t==P[s]:
            continue
        P[t]=s
        S.append(t)
        C[t]+=C[s]
print(' '.join(map(str,C)))
a=int(input())
print(24+(24-a)

### FIXED CODE ###

a=int(input())
print(24+(24-a))
a,b,k=map(int,input().split())
d=[]
for i in range(1,min(a,b)):
  if a%i==0 and b%i==0:
    d.append(i)
print(d[-2])

### FIXED CODE ###

a,b,k=map(int,input().split())
d=[]
for i in range(1,101):
  if(a%i==0 and b%i==0):
    d.append(i)
e=d[::-1]
print(int(e[k-1]))
n = int(input())
d = set()
for i in range(n):
    x = input()
    if x[0] == "i":
        d.append(x[7:])
    else :
        if(x[5:] in d) : print("yes")
        else : print("no")


### FIXED CODE ###

n = int(input())
d = {}
for i in range(n):
    x = input()
    if x[0] == "i":
        d[x[7:]] = 1
    else :
        if(x[5:] in d.keys()) : print("yes")
        else : print("no")
common = []

def bool_work(s, n, k, c):
    i = 0
    while s[i] == 'o':
        if i+c+1 < n:
            j = 1
            if s[j] == 'x':
                while s[j] == 'x':
                    j += 1
            wo_i = bool_work(s[j:], n - j, k, c)
            if j < i+c+1:
                j = i+c+1
                if s[j] == 'x':
                    while s[j] == 'x':
                        j += 1
            w_i = bool_work(s[j:], n - j, k - 1, c)
            if wo_i == 0 and w_i == 1:
                common.append(i)
                return 1
            if wo_i + w_i >= 2:
                return 2
            else:
                return wo_i + w_i
        elif i+c+1 >= n:
            if k > 1:
                return 0
            elif n == 1:
                return 1
            else:
                for char in s[1:]:
                    if char == 'o':
                        return 2
                return 1


n, k, c = map(int, input().split())
s = input()
while s[-1] == 'x':
    s.pop(-1)
bool_work(s, n, k, c)
for com in common:
    print(com)



### FIXED CODE ###

n, k, c = map(int, input().split())
s = " " + input()
work_fw = [0]*k
work_bw = [0]*k
i = 1
now_k = 0
while i <= n and now_k < k:
    if s[i] == 'o':
        work_fw[now_k] = i
        now_k += 1
        i += c
    i += 1
if now_k != k:
    print("")
else:
    i = n
    now_k = k - 1
    while i > 0 and now_k >= 0:
        if s[i] == 'o':
            work_bw[now_k] = i
            now_k -= 1
            i -= c
        i -= 1
    # print(work_fw)
    # print(work_bw)
    for i in range(k):
        if work_fw[i] == work_bw[i]:
            print(work_fw[i] )
# -*- coding: utf-8 -*-
"""
Created on Sat Sep 19 22:03:19 2020

@author: liang
"""

N, X, M = map(int,input().split())
mod_set = {X}
mod_lis = [X]
A = [0]*(10**6+1)
A[0] = X
flag = False
#for i in range(1,N):
for i in range(1,min(10**6,N)):
    tmp = A[i-1]**2%M
    if tmp in mod_set:
        flag = True
        break
    A[i] = tmp
    mod_set.add(tmp)
    mod_lis.append(tmp)

if flag:
    j = mod_lis.index(tmp)
else:
    j = i
T = i - j
ans = 0
if T != -1:  
    ans += sum(mod_lis[:j])
    T_sum = sum(mod_lis[j:])
    """
    【切り捨て演算は必ず()をつけて先に計算】
    """
    ans += T_sum * ((N-j)//T)
    #print((N-j)//T, T_sum)
    T_lis = mod_lis[j:i]   
    ans += sum(T_lis[:(N-j)%T])
else:
    ans = sum(mod_lis)
#print(T_lis)
#print((N-j)%T)
#print(T_lis[:10])
print(ans)
#print(T_sum)
#print(sum(T_lis))

### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Created on Sat Sep 19 22:58:03 2020

@author: liang
"""

N,X,M=map(int,input().split())
a = X
hist = [a]
indices = [-1]*M
indices[a] = 0
flag=0
for i in range(1,min(10**6,N)):
  a = a**2 % M
  if indices[a] != -1:
    idx = indices[a]
    flag=1
    break
  hist.append(a)
  indices[a] = i
  
if flag==0:
  print(sum(hist))
  exit()
  
cycle = hist[idx:]
margin = hist[:idx]
q,r = divmod((N-len(margin)),len(cycle))
ans = 0
ans += sum(margin)
ans += sum(cycle)*q
#print(q,sum(cycle))
ans += sum(cycle[:r])
#print(r)
#print(cycle[:10])
print(ans)
# a,b,k = map(int, input().split())
l = []
for i in range(1,100):
    if (a % i == 0) & (b % i == 0):
        l.append(i)
print(l[k-1])

### FIXED CODE ###

a,b,k = map(int, input().split())
l = []
for i in range(1,101):
    if (a % i == 0) & (b % i == 0):
        l.append(i)
print(l[-k])
from math import gcd
N=int(input())
A=list(map(int, input().split()))

for i in range(N-1):
    if i==0:
        G=gcd(A[0],A[1])
    else:
        G=gcd(G,A[i+1])

print(G)
    
        


### FIXED CODE ###

from fractions import gcd
N=int(input())
A=list(map(int, input().split()))
if len(set(A))==1:
  print(A[0])
  exit()
  
#A=sorted(A, reverse=True)
alleven=True


for i in range(1,N):
  if i==1:
    now=gcd(A[i-1],A[i])
  else:
    now=gcd(now,A[i])

print(now)