output_description: Print the minimum possible final health of the last monster alive.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
      A_1 A_2 ... A_N
attempt: # -*- coding: utf-8 -*-
  
  """
  参考：https://img.atcoder.jp/abc118/editorial.pdf
  """
  
  import sys, re
  from collections import deque, defaultdict, Counter
  from math import sqrt, hypot, factorial, pi, sin, cos, radians, log10
  
  if sys.version_info.minor >= 5:
      from math import gcd
  else:
      from fractions import gcd
  from heapq import heappop, heappush, heapify, heappushpop
  from bisect import bisect_left, bisect_right
  from itertools import permutations, combinations, product, accumulate
  from operator import itemgetter, mul, xor
  from copy import copy, deepcopy
  from functools import reduce, partial
  from fractions import Fraction
  from string import ascii_lowercase, ascii_uppercase, digits
  
  
  def input():
      return sys.stdin.readline().strip()
  
  
  def list2d(a, b, c):
      return [[c] * b for i in range(a)]
  
  
  def list3d(a, b, c, d):
      return [[[d] * c for j in range(b)] for i in range(a)]
  
  
  def ceil(x, y=1):
      return int(-(-x // y))
  
  
  def round(x):
      return int((x * 2 + 1) // 2)
  
  
  def fermat(x, y, MOD):
      return x * pow(y, MOD - 2, MOD) % MOD
  
  
  def lcm(x, y):
      return (x * y) // gcd(x, y)
  
  
  def lcm_list(nums):
      return reduce(lcm, nums, 1)
  
  
  def gcd_list(nums):
      return reduce(gcd, nums, nums[0])
  
  
  def INT():
      return int(input())
  
  
  def MAP():
      return map(int, input().split())
  
  
  def LIST():
      return list(map(int, input().split()))
  
  
  sys.setrecursionlimit(10**9)
  INF = float("inf")
  MOD = 10**9 + 7
  
  N = INT()
  A = LIST()
  
  print(gcd_list(A))
  
problem_description: Statement
  
  There are N monsters, numbered 1, 2, ..., N.
  
  Initially, the health of Monster i is A_i.
  
  Below, a monster with at least 1 health is called alive.
  
  Until there is only one alive monster, the following is repeated:
  
    * A random alive monster attacks another random alive monster.
    * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking.
  
  Find the minimum possible final health of the last monster alive.
samples: [{"input": "4\n    2 10 8 40", "output": "2\n    \n\nWhen only the first monster keeps on attacking, the final health of the last\nmonster will be 2, which is minimum.\n\n* * *"}, {"input": "4\n    5 13 8 1000000000", "output": "1\n    \n\n* * *"}, {"input": "3\n    1000000000 1000000000 1000000000", "output": "1000000000"}]