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