import fractions
from functools import reduce
 
def gcd(*numbers):
    return reduce(fractions.gcd, numbers)
 
def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)
 
 
N = int(input())
A = list(map(int,input().split()))
ans = gcd_list(A)
print(ans) import fractions fractions from functools import reduce def gcd(*numbers):
    return reduce(fractions.gcd, numbers)
  gcd return reduce(fractions.gcd, numbers) reduce(fractions.gcd, numbers) reduce fractions.gcd fractions gcd numbers *numbers def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)
 
  gcd_list return reduce(fractions.gcd, numbers) reduce(fractions.gcd, numbers) reduce fractions.gcd fractions gcd numbers numbers numbers 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 = gcd_list(A) ans gcd_list(A) gcd_list A print(ans) print ans ans = gcd_list(A) gcd_list(A) ans def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)
 
  def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)
 
  gcd_list N = int(input()) int(input()) N A = list(map(int,input().split())) list(map(int,input().split())) A def gcd(*numbers):
    return reduce(fractions.gcd, numbers)
  def gcd(*numbers):
    return reduce(fractions.gcd, numbers)
  gcd
import fractions
from functools import reduce
 
def gcd(*numbers):
    return reduce(fractions.gcd, numbers)
 
def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)
 
 
N = int(input())
A = list(map(int,input().split()))
ans = gcd_list(A)
print(ans)