def gcd(a, b):
    if b==0:    return a
    return gcd(b, a%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 b==0:    return a
    return gcd(b, a%b) gcd if b==0:    return a
     b==0 b 0 return gcd(b, a%b) gcd(b, a%b) gcd b a%b a 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 n=int(input()) int(input()) n A=list(map(int, input().split())) list(map(int, input().split())) A def gcd(a, b):
    if b==0:    return a
    return gcd(b, a%b) def gcd(a, b):
    if b==0:    return a
    return gcd(b, a%b) gcd ans=gcd(A[0], A[1]) gcd(A[0], A[1]) ans ans=gcd(ans, A[i]) gcd(ans, A[i]) ans
def gcd(a, b):
    if b==0:    return a
    return gcd(b, a%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)