def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))

from fractions import gcd
n = ii()
A = iil()
cd = A[0]
for item in A:
    cd = gcd(cd,item)
print(cd) def ii():return int(input()) ii def iim():return map(int,input().split()) iim def iil():return list(map(int,input().split())) iil from fractions import gcd n = ii() n ii() ii A = iil() A iil() iil cd = A[0] cd A[0] A 0 for item in A:
    cd = gcd(cd,item) item A cd = gcd(cd,item) cd gcd(cd,item) gcd cd item print(cd) print cd cd = A[0] A[0] cd def iil():return list(map(int,input().split())) def iil():return list(map(int,input().split())) iil def iim():return map(int,input().split()) def iim():return map(int,input().split()) iim A = iil() iil() A cd = gcd(cd,item) gcd(cd,item) cd def ii():return int(input()) def ii():return int(input()) ii n = ii() ii() n
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))

from fractions import gcd
n = ii()
A = iil()
cd = A[0]
for item in A:
    cd = gcd(cd,item)
print(cd)