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