# -*- coding: utf-8 -*-



N = int(input().strip())

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

#-----



def gcd(a,b):

    x = max(a,b)

    y = min(a,b)



    while y != 0:

        r = x % y

        

        x = y

        y = r

    

    return x



ans = a_list[0]

for i in a_list[1:]:

    ans = gcd(ans, i)



print(ans)

# -*- coding: utf-8 -*-



N = int(input().strip())

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

#-----



def gcd(a,b):

    if b == 0: 

        return a

    return gcd(b, a % b)



ans = a_list[0]

for i in a_list[1:]:

    ans = gcd(ans, i)



print(ans)

# -*- coding: utf-8 -*-
N = int(input().strip())
a_list = [int(i) for i in input().rstrip().split()]
# -----
def gcd(a, b):
    x = max(a, b)
    y = min(a, b)
    while y != 0:
        r = x % y
        x = y
        y = r
    return x


ans = a_list[0]
for i in a_list[1:]:
    ans = gcd(ans, i)
print(ans)

# -*- coding: utf-8 -*-
N = int(input().strip())
a_list = [int(i) for i in input().rstrip().split()]
# -----
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


ans = a_list[0]
for i in a_list[1:]:
    ans = gcd(ans, i)
print(ans)

-    x = max(a, b) -    y = min(a, b) -    while y != 0: -        r = x % y -        x = y -        y = r -    return x +    if b == 0: +        return a +    return gcd(b, a % b)