import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)
  
N = int(input())
L = list(map(int,input().split()))

print(gcd_list(L)) import math math from functools import reduce def gcd(*numbers):
    return reduce(math.gcd, numbers) gcd return reduce(math.gcd, numbers) reduce(math.gcd, numbers) reduce math.gcd math gcd numbers *numbers def gcd_list(numbers):
    return reduce(math.gcd, numbers)
   gcd_list return reduce(math.gcd, numbers) reduce(math.gcd, numbers) reduce math.gcd math gcd numbers numbers numbers N = int(input()) N int(input()) int input() input L = list(map(int,input().split())) L list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split print(gcd_list(L)) print gcd_list(L) gcd_list L def gcd(*numbers):
    return reduce(math.gcd, numbers) def gcd(*numbers):
    return reduce(math.gcd, numbers) gcd N = int(input()) int(input()) N def gcd_list(numbers):
    return reduce(math.gcd, numbers)
   def gcd_list(numbers):
    return reduce(math.gcd, numbers)
   gcd_list L = list(map(int,input().split())) list(map(int,input().split())) L
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)
  
N = int(input())
L = list(map(int,input().split()))

print(gcd_list(L))