from functools import reduce





def gcd(a, b):

    while b:

        a, b = b, a % b

    return a





def gcd_n(numbers):

    return reduce(gcd, numbers)





def main():

    N, *A = list(map(int, open(0).read().split()))

    print((gcd_n(A)))

    return





main()

def main():

    N, *A = list(map(int, open(0).read().split()))

    b = None

    for a in A:

        if b is None:

            b = a

            continue

        while b:

            a, b = b, a % b

        b = a

    print(a)

    return





main()

from functools import reduce


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


def gcd_n(numbers):
    return reduce(gcd, numbers)


def main():
    N, *A = list(map(int, open(0).read().split()))
    print((gcd_n(A)))
    return


main()

def main():
    N, *A = list(map(int, open(0).read().split()))
    b = None
    for a in A:
        if b is None:
            b = a
            continue
        while b:
            a, b = b, a % b
        b = a
    print(a)
    return


main()

-from functools import reduce - - -def gcd(a, b): -    while b: -        a, b = b, a % b -    return a - - -def gcd_n(numbers): -    return reduce(gcd, numbers) - - -    print((gcd_n(A))) +    b = None +    for a in A: +        if b is None: +            b = a +            continue +        while b: +            a, b = b, a % b +        b = a +    print(a)