from math import gcd
def multi_gcd(A):
  g = A[0]
  for a in A:
    g = gcd(g,a)
  return g

def solve():
  N = int(input())
  A = list(map(int, input().split()))
  ans = multi_gcd(A)
  return ans
print(solve()) from math import gcd def multi_gcd(A):
  g = A[0]
  for a in A:
    g = gcd(g,a)
  return g multi_gcd g = A[0] g A[0] A 0 for a in A:
    g = gcd(g,a)
   a A g = gcd(g,a) g gcd(g,a) gcd g a return g g A A def solve():
  N = int(input())
  A = list(map(int, input().split()))
  ans = multi_gcd(A)
  return ans solve 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 = multi_gcd(A) ans multi_gcd(A) multi_gcd A return ans ans print(solve()) print solve() solve def multi_gcd(A):
  g = A[0]
  for a in A:
    g = gcd(g,a)
  return g def multi_gcd(A):
  g = A[0]
  for a in A:
    g = gcd(g,a)
  return g multi_gcd def solve():
  N = int(input())
  A = list(map(int, input().split()))
  ans = multi_gcd(A)
  return ans def solve():
  N = int(input())
  A = list(map(int, input().split()))
  ans = multi_gcd(A)
  return ans solve
from math import gcd
def multi_gcd(A):
  g = A[0]
  for a in A:
    g = gcd(g,a)
  return g

def solve():
  N = int(input())
  A = list(map(int, input().split()))
  ans = multi_gcd(A)
  return ans
print(solve())
