n=int(input())
a=list(map(int,input().split()))
import fractions
def gcdlist(a):
    ans = a[0]
    for i in range(1, len(a)):
        ans = fractions.gcd(ans, a[i])
    return ans
print(gcdlist(a)) 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 import fractions fractions def gcdlist(a):
    ans = a[0]
    for i in range(1, len(a)):
        ans = fractions.gcd(ans, a[i])
    return ans gcdlist ans = a[0] ans a[0] a 0 for i in range(1, len(a)):
        ans = fractions.gcd(ans, a[i])
     i range(1, len(a)) range 1 len(a) len a ans = fractions.gcd(ans, a[i]) ans fractions.gcd(ans, a[i]) fractions.gcd fractions gcd ans a[i] a i return ans ans a a print(gcdlist(a)) print gcdlist(a) gcdlist a n=int(input()) int(input()) n def gcdlist(a):
    ans = a[0]
    for i in range(1, len(a)):
        ans = fractions.gcd(ans, a[i])
    return ans def gcdlist(a):
    ans = a[0]
    for i in range(1, len(a)):
        ans = fractions.gcd(ans, a[i])
    return ans gcdlist a=list(map(int,input().split())) list(map(int,input().split())) a
n=int(input())
a=list(map(int,input().split()))
import fractions
def gcdlist(a):
    ans = a[0]
    for i in range(1, len(a)):
        ans = fractions.gcd(ans, a[i])
    return ans
print(gcdlist(a))