import math

n=int(input())
a=[int(x) for x in input().rstrip().split()]

ans=a[0]
for i in range(1,n):
  ans=math.gcd(ans,a[i])
print(ans)

 import math math n=int(input()) n int(input()) int input() input int(x) for x in input().rstrip().split() for x in input().rstrip().split() x input().rstrip().split() ().rstrip().split ().rstrip() ().rstrip () input rstrip split for x in input().rstrip().split() int(x) int x a=[int(x) for x in input().rstrip().split()] a [int(x) for x in input().rstrip().split()] ans=a[0] ans a[0] a 0 for i in range(1,n):
  ans=math.gcd(ans,a[i]) i range(1,n) range 1 n ans=math.gcd(ans,a[i]) ans math.gcd(ans,a[i]) math.gcd math gcd ans a[i] a i print(ans) print ans n=int(input()) int(input()) n ans=a[0] a[0] ans ans=math.gcd(ans,a[i]) math.gcd(ans,a[i]) ans a=[int(x) for x in input().rstrip().split()] [int(x) for x in input().rstrip().split()] a
import math

n=int(input())
a=[int(x) for x in input().rstrip().split()]

ans=a[0]
for i in range(1,n):
  ans=math.gcd(ans,a[i])
print(ans)


