N = int(eval(input()))

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



A.sort(reverse=True)



denominator = 0

numerator = 1

while A[numerator] != 0:

    A[denominator] = A[denominator] % A[numerator]

    if A[denominator] == 0:

        denominator += 1

        numerator += 1

        if denominator >= N or numerator >= N:

            break

    else:

        denominator, numerator = numerator, denominator

print((min([a for a in A if a > 0])))
N = int(eval(input()))

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



def gcd(a, b):

    if a % b == 0:

        return b

    else:

        return gcd(b, a%b)



ans = gcd(A[0], A[1])

if N > 2:

    for i in range(2, N):

        ans = gcd(ans, A[i])



print(ans)
N = int(eval(input()))
A = list(map(int, input().split()))
A.sort(reverse=True)
denominator = 0
numerator = 1
while A[numerator] != 0:
    A[denominator] = A[denominator] % A[numerator]
    if A[denominator] == 0:
        denominator += 1
        numerator += 1
        if denominator >= N or numerator >= N:
            break
    else:
        denominator, numerator = numerator, denominator
print((min([a for a in A if a > 0])))

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


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


ans = gcd(A[0], A[1])
if N > 2:
    for i in range(2, N):
        ans = gcd(ans, A[i])
print(ans)

-A.sort(reverse=True) -denominator = 0 -numerator = 1 -while A[numerator] != 0: -    A[denominator] = A[denominator] % A[numerator] -    if A[denominator] == 0: -        denominator += 1 -        numerator += 1 -        if denominator >= N or numerator >= N: -            break + + +def gcd(a, b): +    if a % b == 0: +        return b -        denominator, numerator = numerator, denominator -print((min([a for a in A if a > 0]))) +        return gcd(b, a % b) + + +ans = gcd(A[0], A[1]) +if N > 2: +    for i in range(2, N): +        ans = gcd(ans, A[i]) +print(ans)