from functools import reduce
N = int(input())
*A, = map(int, input().split())
def gcd(a,b):
    if a < b:
        a, b = b, a
    while b:
        a, b = b, a%b
    return a
ans = reduce(gcd, A)
print(ans) from functools import reduce N = int(input()) N int(input()) int input() input *A, = map(int, input().split()) *A A map(int, input().split()) map int input().split() ().split () input split def gcd(a,b):
    if a < b:
        a, b = b, a
    while b:
        a, b = b, a%b
    return a gcd if a < b:
        a, b = b, a
     a < b a b a, b = b, a a b b a while b:
        a, b = b, a%b
     b a, b = b, a%b a b b a%b a b return a a a a b b ans = reduce(gcd, A) ans reduce(gcd, A) reduce gcd A print(ans) print ans def gcd(a,b):
    if a < b:
        a, b = b, a
    while b:
        a, b = b, a%b
    return a def gcd(a,b):
    if a < b:
        a, b = b, a
    while b:
        a, b = b, a%b
    return a gcd ans = reduce(gcd, A) reduce(gcd, A) ans N = int(input()) int(input()) N
from functools import reduce
N = int(input())
*A, = map(int, input().split())
def gcd(a,b):
    if a < b:
        a, b = b, a
    while b:
        a, b = b, a%b
    return a
ans = reduce(gcd, A)
print(ans)