import sys

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

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

ans = gcd(a[0], a[1])
for x in a[2:]:
    tmp = gcd(ans, x)
    if tmp < ans:
        ans = tmp
print(ans) import sys sys 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 = int(input()) n int(input()) int input() input a = list(map(int, sys.stdin.readline().split())) a list(map(int, sys.stdin.readline().split())) list map(int, sys.stdin.readline().split()) map int sys.stdin.readline().split() sys.stdin.readline().split sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline split ans = gcd(a[0], a[1]) ans gcd(a[0], a[1]) gcd a[0] a 0 a[1] a 1 for x in a[2:]:
    tmp = gcd(ans, x)
    if tmp < ans:
        ans = tmp x a[2:] a 2: 2 tmp = gcd(ans, x) tmp gcd(ans, x) gcd ans x if tmp < ans:
        ans = tmp tmp < ans tmp ans ans = tmp ans tmp print(ans) print ans n = int(input()) int(input()) n ans = tmp tmp ans ans = gcd(a[0], a[1]) gcd(a[0], a[1]) ans a = list(map(int, sys.stdin.readline().split())) list(map(int, sys.stdin.readline().split())) a 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 tmp = gcd(ans, x) gcd(ans, x) tmp
import sys

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

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

ans = gcd(a[0], a[1])
for x in a[2:]:
    tmp = gcd(ans, x)
    if tmp < ans:
        ans = tmp
print(ans)
