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