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