n = int(eval(input()))

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



m = 0

tmp = min(a)

while m != tmp:

    m = tmp

    for i in range(n):

        if a[i] != m:

            a[i] = a[i] % m

        if a[i] < m and a[i] != 0:

            tmp = a[i]

print(m)

import math

from functools import reduce



def gcd_list(numbers):

    return reduce(math.gcd, numbers)



n = int(eval(input()))

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



print((gcd_list(a)))

n = int(eval(input()))
a = list(map(int, input().split()))
m = 0
tmp = min(a)
while m != tmp:
    m = tmp
    for i in range(n):
        if a[i] != m:
            a[i] = a[i] % m
        if a[i] < m and a[i] != 0:
            tmp = a[i]
print(m)

import math
from functools import reduce


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


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

+import math +from functools import reduce + + +def gcd_list(numbers): +    return reduce(math.gcd, numbers) + + -m = 0 -tmp = min(a) -while m != tmp: -    m = tmp -    for i in range(n): -        if a[i] != m: -            a[i] = a[i] % m -        if a[i] < m and a[i] != 0: -            tmp = a[i] -print(m) +print((gcd_list(a)))