# coding: utf-8

# https://atcoder.jp/contests/abc118


def main():
    N = int(input())
    A = list(map(int, input().split()))

    def gcd(n, m):
        """
        2020/05/22
        """
        while True:
            if m == 0:
                return n
            n, m = m, n % m

    for i in range(N-1):
        A[i+1] = gcd(A[i], A[i+1])

    return A[i+1]


print(main()) def main():
    N = int(input())
    A = list(map(int, input().split()))

    def gcd(n, m):
        """
        2020/05/22
        """
        while True:
            if m == 0:
                return n
            n, m = m, n % m

    for i in range(N-1):
        A[i+1] = gcd(A[i], A[i+1])

    return A[i+1] main N = int(input()) N int(input()) int input() input A = list(map(int, input().split())) A list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split def gcd(n, m):
        """
        2020/05/22
        """
        while True:
            if m == 0:
                return n
            n, m = m, n % m

     gcd """
        2020/05/22
        """ while True:
            if m == 0:
                return n
            n, m = m, n % m

     True if m == 0:
                return n
             m == 0 m 0 return n n n, m = m, n % m n m m n % m n m n n m m for i in range(N-1):
        A[i+1] = gcd(A[i], A[i+1])

     i range(N-1) range N-1 N 1 A[i+1] = gcd(A[i], A[i+1]) A[i+1] A i+1 i 1 gcd(A[i], A[i+1]) gcd A[i] A i A[i+1] A i+1 i 1 return A[i+1] A[i+1] A i+1 i 1 print(main()) print main() main def main():
    N = int(input())
    A = list(map(int, input().split()))

    def gcd(n, m):
        """
        2020/05/22
        """
        while True:
            if m == 0:
                return n
            n, m = m, n % m

    for i in range(N-1):
        A[i+1] = gcd(A[i], A[i+1])

    return A[i+1] def main():
    N = int(input())
    A = list(map(int, input().split()))

    def gcd(n, m):
        """
        2020/05/22
        """
        while True:
            if m == 0:
                return n
            n, m = m, n % m

    for i in range(N-1):
        A[i+1] = gcd(A[i], A[i+1])

    return A[i+1] main
# coding: utf-8

# https://atcoder.jp/contests/abc118


def main():
    N = int(input())
    A = list(map(int, input().split()))

    def gcd(n, m):
        """
        2020/05/22
        """
        while True:
            if m == 0:
                return n
            n, m = m, n % m

    for i in range(N-1):
        A[i+1] = gcd(A[i], A[i+1])

    return A[i+1]


print(main())
