N = int(eval(input()))

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



ans = 10 ** 10

while min(A) != ans:

    ans = min(A)

    for i, a_i in enumerate(A):

        if a_i > ans:

            A[i] = a_i % ans

            if A[i] == 0:

                del A[i]



print(ans)
N = int(eval(input()))

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





def gcd(a, b):

    if b == 0:

        return a

    return gcd(b, a % b)





def gcd_arr(a):

    ans = a[0]

    for i, a_i in enumerate(a):

        ans = gcd(ans, a_i)

    return ans



print((gcd_arr(A)))
N = int(eval(input()))
A = list(map(int, input().split()))
ans = 10**10
while min(A) != ans:
    ans = min(A)
    for i, a_i in enumerate(A):
        if a_i > ans:
            A[i] = a_i % ans
            if A[i] == 0:
                del A[i]
print(ans)

N = int(eval(input()))
A = list(map(int, input().split()))


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


def gcd_arr(a):
    ans = a[0]
    for i, a_i in enumerate(a):
        ans = gcd(ans, a_i)
    return ans


print((gcd_arr(A)))

-ans = 10**10 -while min(A) != ans: -    ans = min(A) -    for i, a_i in enumerate(A): -        if a_i > ans: -            A[i] = a_i % ans -            if A[i] == 0: -                del A[i] -print(ans) + + +def gcd(a, b): +    if b == 0: +        return a +    return gcd(b, a % b) + + +def gcd_arr(a): +    ans = a[0] +    for i, a_i in enumerate(a): +        ans = gcd(ans, a_i) +    return ans + + +print((gcd_arr(A)))