def gcd(a,b):

    if a < b:

        return gcd(b,a)

    else:

        if a%b == 0:

            return b

        else:

            return gcd(b,a%b)

N = int(eval(input()))

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

ans = src[0]

for i in range(1,N)[::-1]:

    ans = gcd(ans,src[i])

print(ans)
def Gcd(a,b):

    if a < b:

        return Gcd(b,a)

    else:

        if a%b:

            return Gcd(b,a%b)

        else:

            return b



N = int(eval(input()))

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

gcd = arr[0]

for i in arr:

    gcd = Gcd(gcd,i)

print(gcd)
def gcd(a, b):
    if a < b:
        return gcd(b, a)
    else:
        if a % b == 0:
            return b
        else:
            return gcd(b, a % b)


N = int(eval(input()))
src = sorted(list(map(int, input().split())))
ans = src[0]
for i in range(1, N)[::-1]:
    ans = gcd(ans, src[i])
print(ans)

def Gcd(a, b):
    if a < b:
        return Gcd(b, a)
    else:
        if a % b:
            return Gcd(b, a % b)
        else:
            return b


N = int(eval(input()))
arr = list(map(int, input().split()))
gcd = arr[0]
for i in arr:
    gcd = Gcd(gcd, i)
print(gcd)

-def gcd(a, b): +def Gcd(a, b): -        return gcd(b, a) +        return Gcd(b, a) -        if a % b == 0: +        if a % b: +            return Gcd(b, a % b) +        else: -        else: -            return gcd(b, a % b) -src = sorted(list(map(int, input().split()))) -ans = src[0] -for i in range(1, N)[::-1]: -    ans = gcd(ans, src[i]) -print(ans) +arr = list(map(int, input().split())) +gcd = arr[0] +for i in arr: +    gcd = Gcd(gcd, i) +print(gcd)