from math import gcd
def readinput():
    n=int(input())
    a=list(map(int,input().split()))
    return n,a

def main(n,a):
    ans=gcd(a[0],a[1])
    for i in range(2,n):
        ans=gcd(ans,a[i])
    return ans

if __name__=='__main__':
    n,a=readinput()
    ans=main(n,a)
    print(ans) from math import gcd def readinput():
    n=int(input())
    a=list(map(int,input().split()))
    return n,a readinput n=int(input()) n int(input()) int input() input a=list(map(int,input().split())) a list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split return n,a return n,a n a def main(n,a):
    ans=gcd(a[0],a[1])
    for i in range(2,n):
        ans=gcd(ans,a[i])
    return ans main ans=gcd(a[0],a[1]) ans gcd(a[0],a[1]) gcd a[0] a 0 a[1] a 1 for i in range(2,n):
        ans=gcd(ans,a[i])
     i range(2,n) range 2 n ans=gcd(ans,a[i]) ans gcd(ans,a[i]) gcd ans a[i] a i return ans ans n n a a if __name__=='__main__':
    n,a=readinput()
    ans=main(n,a)
    print(ans) __name__=='__main__' __name__ '__main__' n,a=readinput() n readinput() readinput a ans=main(n,a) ans main(n,a) main n a print(ans) print ans a=readinput() readinput() a def main(n,a):
    ans=gcd(a[0],a[1])
    for i in range(2,n):
        ans=gcd(ans,a[i])
    return ans def main(n,a):
    ans=gcd(a[0],a[1])
    for i in range(2,n):
        ans=gcd(ans,a[i])
    return ans main n,a=readinput() readinput() n ans=main(n,a) main(n,a) ans def readinput():
    n=int(input())
    a=list(map(int,input().split()))
    return n,a def readinput():
    n=int(input())
    a=list(map(int,input().split()))
    return n,a readinput
from math import gcd
def readinput():
    n=int(input())
    a=list(map(int,input().split()))
    return n,a

def main(n,a):
    ans=gcd(a[0],a[1])
    for i in range(2,n):
        ans=gcd(ans,a[i])
    return ans

if __name__=='__main__':
    n,a=readinput()
    ans=main(n,a)
    print(ans)
