import sys

n = int(eval(input()))

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

sys.setrecursionlimit(10 ** 5)





def cut(l):

    l.sort()

    nokori = [l[0]]

    for i in range(1, len(l)):

        b = l[i] % l[0]

        if b != 0:

            nokori.append(b)

    if len(nokori) != 1:

        return cut(nokori)

    return nokori[0]





print((cut(a)))

import sys



n = int(eval(input()))

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

sys.setrecursionlimit(10 ** 5)





def gcd(a, b):

    if b < a:

        a, b = b, a

    if b % a == 0:

        return a

    else:

        return gcd(a, b % a)





def gcdl(num, n):

    ans = num[0]

    for i in range(n):

        ans = gcd(ans, num[i])

    return ans





print((gcdl(al, n)))

import sys

n = int(eval(input()))
a = list(map(int, input().split()))
sys.setrecursionlimit(10**5)


def cut(l):
    l.sort()
    nokori = [l[0]]
    for i in range(1, len(l)):
        b = l[i] % l[0]
        if b != 0:
            nokori.append(b)
    if len(nokori) != 1:
        return cut(nokori)
    return nokori[0]


print((cut(a)))

import sys

n = int(eval(input()))
al = list(map(int, input().split()))
sys.setrecursionlimit(10**5)


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


def gcdl(num, n):
    ans = num[0]
    for i in range(n):
        ans = gcd(ans, num[i])
    return ans


print((gcdl(al, n)))

-a = list(map(int, input().split())) +al = list(map(int, input().split())) -def cut(l): -    l.sort() -    nokori = [l[0]] -    for i in range(1, len(l)): -        b = l[i] % l[0] -        if b != 0: -            nokori.append(b) -    if len(nokori) != 1: -        return cut(nokori) -    return nokori[0] +def gcd(a, b): +    if b < a: +        a, b = b, a +    if b % a == 0: +        return a +    else: +        return gcd(a, b % a) -print((cut(a))) +def gcdl(num, n): +    ans = num[0] +    for i in range(n): +        ans = gcd(ans, num[i]) +    return ans + + +print((gcdl(al, n)))