import functools

import fractions

N=int(eval(input()))

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

print((functools.reduce(fractions.gcd,A)))
import functools

import math

N=int(eval(input()))

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

print((functools.reduce(math.gcd,A)))
import functools
import fractions

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

import functools
import math

N = int(eval(input()))
A = list(map(int, input().split()))
print((functools.reduce(math.gcd, A)))

-import fractions +import math -print((functools.reduce(fractions.gcd, A))) +print((functools.reduce(math.gcd, A)))