from fractions import gcd

from functools import reduce

import copy



N = int(eval(input()))

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



while len(alist) > 1:

  min_a = min(alist)

  alist.remove(min_a)

  new_alist = [min_a]

  for a in alist:

    if int(a%min_a) != 0:

      new_alist.append(int(a%min_a))

  alist = copy.deepcopy(new_alist)



print((new_alist[0]))
import fractions

import functools

_ = int(eval(input()))

print((functools.reduce(fractions.gcd, list(map(int, input().split())))))
from fractions import gcd
from functools import reduce
import copy

N = int(eval(input()))
alist = list(map(int, input().split()))
while len(alist) > 1:
    min_a = min(alist)
    alist.remove(min_a)
    new_alist = [min_a]
    for a in alist:
        if int(a % min_a) != 0:
            new_alist.append(int(a % min_a))
    alist = copy.deepcopy(new_alist)
print((new_alist[0]))

import fractions
import functools

_ = int(eval(input()))
print((functools.reduce(fractions.gcd, list(map(int, input().split())))))

-from fractions import gcd -from functools import reduce -import copy +import fractions +import functools -N = int(eval(input())) -alist = list(map(int, input().split())) -while len(alist) > 1: -    min_a = min(alist) -    alist.remove(min_a) -    new_alist = [min_a] -    for a in alist: -        if int(a % min_a) != 0: -            new_alist.append(int(a % min_a)) -    alist = copy.deepcopy(new_alist) -print((new_alist[0])) +_ = int(eval(input())) +print((functools.reduce(fractions.gcd, list(map(int, input().split())))))