def gcd(x, y):
  if y==0: return x
  return gcd(y, x%y)

N = int(input())
A = list(map(int, input().split()))
a = A[0]
for i in range(N-1):
  a = gcd(a, A[i+1])
print(a) def gcd(x, y):
  if y==0: return x
  return gcd(y, x%y) gcd if y==0: return x
   y==0 y 0 return gcd(y, x%y) gcd(y, x%y) gcd y x%y x y x x y y 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 a = A[0] a A[0] A 0 for i in range(N-1):
  a = gcd(a, A[i+1]) i range(N-1) range N-1 N 1 a = gcd(a, A[i+1]) a gcd(a, A[i+1]) gcd a A[i+1] A i+1 i 1 print(a) print a def gcd(x, y):
  if y==0: return x
  return gcd(y, x%y) def gcd(x, y):
  if y==0: return x
  return gcd(y, x%y) gcd N = int(input()) int(input()) N A = list(map(int, input().split())) list(map(int, input().split())) A a = gcd(a, A[i+1]) gcd(a, A[i+1]) a a = A[0] A[0] a
def gcd(x, y):
  if y==0: return x
  return gcd(y, x%y)

N = int(input())
A = list(map(int, input().split()))
a = A[0]
for i in range(N-1):
  a = gcd(a, A[i+1])
print(a)