

import math



N = int(eval(input()))

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



x = A[0]

for a in A:

    x = math.gcd(x, a)



print(x)





import math

N = int(eval(input()))

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



ans = A[0]

for a in A[1:]:

    ans = math.gcd(a, ans)



print(ans)





import math

N = int(eval(input()))
A = [int(x) for x in input().split()]
x = A[0]
for a in A:
    x = math.gcd(x, a)
print(x)

import math

N = int(eval(input()))
A = [int(x) for x in input().split()]
ans = A[0]
for a in A[1:]:
    ans = math.gcd(a, ans)
print(ans)

-x = A[0] -for a in A: -    x = math.gcd(x, a) -print(x) +ans = A[0] +for a in A[1:]: +    ans = math.gcd(a, ans) +print(ans)