from math import gcd


def lgcd(l):
    res = l[0]
    for i in range(1, len(l)):
        res = gcd(res, l[i])

    return res


n = int(input())
print(lgcd(list(map(int, input().split())))) from math import gcd def lgcd(l):
    res = l[0]
    for i in range(1, len(l)):
        res = gcd(res, l[i])

    return res lgcd res = l[0] res l[0] l 0 for i in range(1, len(l)):
        res = gcd(res, l[i])

     i range(1, len(l)) range 1 len(l) len l res = gcd(res, l[i]) res gcd(res, l[i]) gcd res l[i] l i return res res l l n = int(input()) n int(input()) int input() input print(lgcd(list(map(int, input().split())))) print lgcd(list(map(int, input().split()))) lgcd list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split def lgcd(l):
    res = l[0]
    for i in range(1, len(l)):
        res = gcd(res, l[i])

    return res def lgcd(l):
    res = l[0]
    for i in range(1, len(l)):
        res = gcd(res, l[i])

    return res lgcd n = int(input()) int(input()) n
from math import gcd


def lgcd(l):
    res = l[0]
    for i in range(1, len(l)):
        res = gcd(res, l[i])

    return res


n = int(input())
print(lgcd(list(map(int, input().split()))))
