def gcd(a, b):
    if a<b:
        a,b = b,a
    r = a%b
    while r != 0:
        a = b
        b = r
        r = a % b
    return b
n = int(input())
a = list(map(int,input().split()))
ans = gcd(a[0],a[1])
for i in range(2,n):
    ans = gcd(ans,a[i])
print(ans) def gcd(a, b):
    if a<b:
        a,b = b,a
    r = a%b
    while r != 0:
        a = b
        b = r
        r = a % b
    return b gcd if a<b:
        a,b = b,a
     a<b a b a,b = b,a a b b a r = a%b r a%b a b while r != 0:
        a = b
        b = r
        r = a % b
     r != 0 r 0 a = b a b b = r b r r = a % b r a % b a b return b b 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 = 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 print(ans) print ans ans = gcd(a[0],a[1]) gcd(a[0],a[1]) ans def gcd(a, b):
    if a<b:
        a,b = b,a
    r = a%b
    while r != 0:
        a = b
        b = r
        r = a % b
    return b def gcd(a, b):
    if a<b:
        a,b = b,a
    r = a%b
    while r != 0:
        a = b
        b = r
        r = a % b
    return b gcd a = list(map(int,input().split())) list(map(int,input().split())) a n = int(input()) int(input()) n ans = gcd(ans,a[i]) gcd(ans,a[i]) ans
def gcd(a, b):
    if a<b:
        a,b = b,a
    r = a%b
    while r != 0:
        a = b
        b = r
        r = a % b
    return b
n = int(input())
a = list(map(int,input().split()))
ans = gcd(a[0],a[1])
for i in range(2,n):
    ans = gcd(ans,a[i])
print(ans)