import math
from functools import reduce

N = int(input())
A = list(map(int,input().split()))

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

N = int(input())
A = list(map(int,input().split()))

def gcd_list(numbers):
    return reduce(math.gcd, numbers)
  
print(gcd_list(A))