n = int(eval(input()))

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



hp = max(l)



l.sort()



while hp > 1 and len(l) != 1:

    a = l[0]

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

        l[i] %= a

    l.sort()

    while l[0] == 0:

        l.remove(0)

    if l[0] < hp:

        hp = l[0]



print(hp)
import fractions

from functools import reduce



def gcd(*numbers):

    return reduce(fractions.gcd, numbers)



def gcd_list(numbers):

    return reduce(fractions.gcd, numbers)



n = int(eval(input()))

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



print((gcd_list(x)))
n = int(eval(input()))
l = list(map(int, input().split()))
hp = max(l)
l.sort()
while hp > 1 and len(l) != 1:
    a = l[0]
    for i in range(1, len(l)):
        l[i] %= a
    l.sort()
    while l[0] == 0:
        l.remove(0)
    if l[0] < hp:
        hp = l[0]
print(hp)

import fractions
from functools import reduce


def gcd(*numbers):
    return reduce(fractions.gcd, numbers)


def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)


n = int(eval(input()))
x = list(map(int, input().split()))
print((gcd_list(x)))

+import fractions +from functools import reduce + + +def gcd(*numbers): +    return reduce(fractions.gcd, numbers) + + +def gcd_list(numbers): +    return reduce(fractions.gcd, numbers) + + -l = list(map(int, input().split())) -hp = max(l) -l.sort() -while hp > 1 and len(l) != 1: -    a = l[0] -    for i in range(1, len(l)): -        l[i] %= a -    l.sort() -    while l[0] == 0: -        l.remove(0) -    if l[0] < hp: -        hp = l[0] -print(hp) +x = list(map(int, input().split())) +print((gcd_list(x)))