n = int(eval(input()))

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



def euclid(a, b):

    c,d = sorted([a, b])

    r = 1

    while (r > 0):

        r = d % c

        c,d = r,c

    return d



for i in range(n-1):

    if i == 0:

        ans = a[0]

    ans = euclid(ans, a[i+1])

print(ans)
def euclid(n, a_list):

    a1, a2 = a_list[0:2]

    gcd_ = gcd(a1, a2)

    for i in range(2, n):

        gcd_ = gcd(gcd_, a_list[i])

    return gcd_



def gcd(a1, a2):

    r = 1

    while (r > 0):

        r = a1 % a2

        a1, a2 = a2, r

    return a1





n = int(eval(input()))

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

a_list = sorted(a_list)

ans = euclid(n, a_list)

print(ans)
n = int(eval(input()))
a = [int(i) for i in input().split()]


def euclid(a, b):
    c, d = sorted([a, b])
    r = 1
    while r > 0:
        r = d % c
        c, d = r, c
    return d


for i in range(n - 1):
    if i == 0:
        ans = a[0]
    ans = euclid(ans, a[i + 1])
print(ans)

def euclid(n, a_list):
    a1, a2 = a_list[0:2]
    gcd_ = gcd(a1, a2)
    for i in range(2, n):
        gcd_ = gcd(gcd_, a_list[i])
    return gcd_


def gcd(a1, a2):
    r = 1
    while r > 0:
        r = a1 % a2
        a1, a2 = a2, r
    return a1


n = int(eval(input()))
a_list = [int(i) for i in input().split()]
a_list = sorted(a_list)
ans = euclid(n, a_list)
print(ans)

-n = int(eval(input())) -a = [int(i) for i in input().split()] +def euclid(n, a_list): +    a1, a2 = a_list[0:2] +    gcd_ = gcd(a1, a2) +    for i in range(2, n): +        gcd_ = gcd(gcd_, a_list[i]) +    return gcd_ -def euclid(a, b): -    c, d = sorted([a, b]) +def gcd(a1, a2): -        r = d % c -        c, d = r, c -    return d +        r = a1 % a2 +        a1, a2 = a2, r +    return a1 -for i in range(n - 1): -    if i == 0: -        ans = a[0] -    ans = euclid(ans, a[i + 1]) +n = int(eval(input())) +a_list = [int(i) for i in input().split()] +a_list = sorted(a_list) +ans = euclid(n, a_list)