N = int(eval(input()))

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



def GCD(a, b):

    a, b = max(a, b), min(a, b)

    while a % b != 0:

        a, b = b, a%b

    return b



Ans = GCD(A[0], A[1])

for i in range(2, N):

    Ans = GCD(Ans, A[i])

print(Ans)
import sys



def gcd(a, b):

    a, b = max(a, b), min(a, b)

    while a % b > 0:

        a, b = b, a % b

    return b



def solve():

    input = sys.stdin.readline

    N = int(eval(input()))

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

    gcdA = A[0]

    for a in A: gcdA = gcd(gcdA, a)

    print(gcdA)



    return 0



if __name__ == "__main__":

    solve()
N = int(eval(input()))
A = [int(a) for a in input().split()]


def GCD(a, b):
    a, b = max(a, b), min(a, b)
    while a % b != 0:
        a, b = b, a % b
    return b


Ans = GCD(A[0], A[1])
for i in range(2, N):
    Ans = GCD(Ans, A[i])
print(Ans)

import sys


def gcd(a, b):
    a, b = max(a, b), min(a, b)
    while a % b > 0:
        a, b = b, a % b
    return b


def solve():
    input = sys.stdin.readline
    N = int(eval(input()))
    A = [int(i) for i in input().split()]
    gcdA = A[0]
    for a in A:
        gcdA = gcd(gcdA, a)
    print(gcdA)
    return 0


if __name__ == "__main__":
    solve()

-N = int(eval(input())) -A = [int(a) for a in input().split()] +import sys -def GCD(a, b): +def gcd(a, b): -    while a % b != 0: +    while a % b > 0: -Ans = GCD(A[0], A[1]) -for i in range(2, N): -    Ans = GCD(Ans, A[i]) -print(Ans) +def solve(): +    input = sys.stdin.readline +    N = int(eval(input())) +    A = [int(i) for i in input().split()] +    gcdA = A[0] +    for a in A: +        gcdA = gcd(gcdA, a) +    print(gcdA) +    return 0 + + +if __name__ == "__main__": +    solve()