# 最大公約数
def gcd(a,b):
    while b != 0:
        a,b = b, a%b
    return a


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

ans = 0
for i in a:
    ans = gcd(ans,i)
print(ans) def gcd(a,b):
    while b != 0:
        a,b = b, a%b
    return a gcd while b != 0:
        a,b = b, a%b
     b != 0 b 0 a,b = b, a%b a b b a%b a b return a a a a b b 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 ans = 0 ans 0 for i in a:
    ans = gcd(ans,i) i a ans = gcd(ans,i) ans gcd(ans,i) gcd ans i print(ans) print ans a = list(map(int,input().split())) list(map(int,input().split())) a n = int(input()) int(input()) n def gcd(a,b):
    while b != 0:
        a,b = b, a%b
    return a def gcd(a,b):
    while b != 0:
        a,b = b, a%b
    return a gcd ans = gcd(ans,i) gcd(ans,i) ans ans = 0 0 ans
# 最大公約数
def gcd(a,b):
    while b != 0:
        a,b = b, a%b
    return a


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

ans = 0
for i in a:
    ans = gcd(ans,i)
print(ans)