import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

def gcd(m, n):
    r = m % n
    return gcd(n, r) if r else n

n, *a = map(int, read().split())

res = gcd(a[0],a[1])
for i in range(2,n):
    res = gcd(res, a[i])

print(res) import sys sys read = sys.stdin.buffer.read read sys.stdin.buffer.read sys.stdin.buffer sys.stdin sys stdin buffer read readline = sys.stdin.buffer.readline readline sys.stdin.buffer.readline sys.stdin.buffer sys.stdin sys stdin buffer readline readlines = sys.stdin.buffer.readlines readlines sys.stdin.buffer.readlines sys.stdin.buffer sys.stdin sys stdin buffer readlines def gcd(m, n):
    r = m % n
    return gcd(n, r) if r else n gcd r = m % n r m % n m n return gcd(n, r) if r else n gcd(n, r) if r else n r gcd(n, r) gcd n r n m m n n n, *a = map(int, read().split()) n map(int, read().split()) map int read().split() ().split () read split *a a res = gcd(a[0],a[1]) res gcd(a[0],a[1]) gcd a[0] a 0 a[1] a 1 for i in range(2,n):
    res = gcd(res, a[i]) i range(2,n) range 2 n res = gcd(res, a[i]) res gcd(res, a[i]) gcd res a[i] a i print(res) print res readline = sys.stdin.buffer.readline sys.stdin.buffer.readline readline n, *a = map(int, read().split()) map(int, read().split()) n res = gcd(a[0],a[1]) gcd(a[0],a[1]) res readlines = sys.stdin.buffer.readlines sys.stdin.buffer.readlines readlines read = sys.stdin.buffer.read sys.stdin.buffer.read read res = gcd(res, a[i]) gcd(res, a[i]) res def gcd(m, n):
    r = m % n
    return gcd(n, r) if r else n def gcd(m, n):
    r = m % n
    return gcd(n, r) if r else n gcd
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

def gcd(m, n):
    r = m % n
    return gcd(n, r) if r else n

n, *a = map(int, read().split())

res = gcd(a[0],a[1])
for i in range(2,n):
    res = gcd(res, a[i])

print(res)