n = int(input())
ls = list(map(int,input().split()))
#a,bの最大公約数
def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b,a%b)
#リスト l の最大公約数
def gcdlist(l):
    a = l[0]
    for i in range(len(l)):
        a = gcd(a,l[i])
    return a
print(gcdlist(ls)) n = int(input()) n int(input()) int input() input ls = list(map(int,input().split())) ls list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b,a%b)
#リスト l の最大公約数 gcd if b == 0:
        return a
    else:
        return gcd(b,a%b)
#リスト l の最大公約数 b == 0 b 0 return a a return gcd(b,a%b) gcd(b,a%b) gcd b a%b a b a a b b def gcdlist(l):
    a = l[0]
    for i in range(len(l)):
        a = gcd(a,l[i])
    return a gcdlist a = l[0] a l[0] l 0 for i in range(len(l)):
        a = gcd(a,l[i])
     i range(len(l)) range len(l) len l a = gcd(a,l[i]) a gcd(a,l[i]) gcd a l[i] l i return a a l l print(gcdlist(ls)) print gcdlist(ls) gcdlist ls def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b,a%b)
#リスト l の最大公約数 def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b,a%b)
#リスト l の最大公約数 gcd n = int(input()) int(input()) n ls = list(map(int,input().split())) list(map(int,input().split())) ls def gcdlist(l):
    a = l[0]
    for i in range(len(l)):
        a = gcd(a,l[i])
    return a def gcdlist(l):
    a = l[0]
    for i in range(len(l)):
        a = gcd(a,l[i])
    return a gcdlist
n = int(input())
ls = list(map(int,input().split()))
#a,bの最大公約数
def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b,a%b)
#リスト l の最大公約数
def gcdlist(l):
    a = l[0]
    for i in range(len(l)):
        a = gcd(a,l[i])
    return a
print(gcdlist(ls))