n=int(eval(input()))

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



while len(a)!=1:

  t=min(a)

  a=set(i for i in [x%t if x!=t else t for x in a] if i)



print((a.pop()))
from fractions import gcd

from functools import reduce

_=eval(input())

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

print((reduce(gcd,a)))
n = int(eval(input()))
a = set(map(int, input().split()))
while len(a) != 1:
    t = min(a)
    a = set(i for i in [x % t if x != t else t for x in a] if i)
print((a.pop()))

from fractions import gcd
from functools import reduce

_ = eval(input())
(*a,) = list(map(int, input().split()))
print((reduce(gcd, a)))

-n = int(eval(input())) -a = set(map(int, input().split())) -while len(a) != 1: -    t = min(a) -    a = set(i for i in [x % t if x != t else t for x in a] if i) -print((a.pop())) +from fractions import gcd +from functools import reduce + +_ = eval(input()) +(*a,) = list(map(int, input().split())) +print((reduce(gcd, a)))