from fractions import gcd





def main():

    n = int(eval(input()))

    As = list(map(int, input().split()))

    ans = gcd(As[0], As[1])

    for i in range(2, n):

        ans = gcd(ans, As[i])

    print(ans)





if __name__ == "__main__":

    main()

import math





def main():

    n = int(eval(input()))

    As = sorted(list(map(int, input().split())))



    ans = math.gcd(As[0], As[1])

    for i in range(2, n):

        ans = math.gcd(ans, As[i])

    print(ans)





if __name__ == "__main__":

    main()

from fractions import gcd


def main():
    n = int(eval(input()))
    As = list(map(int, input().split()))
    ans = gcd(As[0], As[1])
    for i in range(2, n):
        ans = gcd(ans, As[i])
    print(ans)


if __name__ == "__main__":
    main()

import math


def main():
    n = int(eval(input()))
    As = sorted(list(map(int, input().split())))
    ans = math.gcd(As[0], As[1])
    for i in range(2, n):
        ans = math.gcd(ans, As[i])
    print(ans)


if __name__ == "__main__":
    main()

-from fractions import gcd +import math -    As = list(map(int, input().split())) -    ans = gcd(As[0], As[1]) +    As = sorted(list(map(int, input().split()))) +    ans = math.gcd(As[0], As[1]) -        ans = gcd(ans, As[i]) +        ans = math.gcd(ans, As[i])