from sys import stdin

from functools import reduce

import fractions

#input = stdin.readline

N = int(eval(input()))

A = list(set(map(int,input().split())))

answer = reduce(fractions.gcd, A)

print(answer)
def gcd(a,b):

    if(a%b==0):

        return b

    else:

        return gcd(b,a%b)

N = int(eval(input()))

s = [int(x) for x in input().split()]

tmp = s[0]

for i in s[1:]:

    tmp = gcd(tmp,i)

print(tmp)
from sys import stdin
from functools import reduce
import fractions

# input = stdin.readline
N = int(eval(input()))
A = list(set(map(int, input().split())))
answer = reduce(fractions.gcd, A)
print(answer)

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


N = int(eval(input()))
s = [int(x) for x in input().split()]
tmp = s[0]
for i in s[1:]:
    tmp = gcd(tmp, i)
print(tmp)

-from sys import stdin -from functools import reduce -import fractions +def gcd(a, b): +    if a % b == 0: +        return b +    else: +        return gcd(b, a % b) -# input = stdin.readline + -A = list(set(map(int, input().split()))) -answer = reduce(fractions.gcd, A) -print(answer) +s = [int(x) for x in input().split()] +tmp = s[0] +for i in s[1:]: +    tmp = gcd(tmp, i) +print(tmp)