from fractions import gcd
N=int(input())
A=[int(i) for i in input().split()]
ans=A[0]
for i in range(N-1):
    ans=gcd(ans,A[i+1])
print(ans) from fractions import gcd N=int(input()) N int(input()) int input() input int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i A=[int(i) for i in input().split()] A [int(i) for i in input().split()] ans=A[0] ans A[0] A 0 for i in range(N-1):
    ans=gcd(ans,A[i+1]) i range(N-1) range N-1 N 1 ans=gcd(ans,A[i+1]) ans gcd(ans,A[i+1]) gcd ans A[i+1] A i+1 i 1 print(ans) print ans A=[int(i) for i in input().split()] [int(i) for i in input().split()] A N=int(input()) int(input()) N ans=A[0] A[0] ans ans=gcd(ans,A[i+1]) gcd(ans,A[i+1]) ans
from fractions import gcd
N=int(input())
A=[int(i) for i in input().split()]
ans=A[0]
for i in range(N-1):
    ans=gcd(ans,A[i+1])
print(ans)