import fractions
from functools import reduce

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

N = int(input())
nums = [int(i) for i in input().split()]

print(gcd_list(nums)) import fractions fractions from functools import reduce 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 int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i nums = [int(i) for i in input().split()] nums [int(i) for i in input().split()] print(gcd_list(nums)) print gcd_list(nums) gcd_list nums nums = [int(i) for i in input().split()] [int(i) for i in input().split()] nums N = int(input()) int(input()) N def gcd_list(numbers):
    return reduce(fractions.gcd, numbers) def gcd_list(numbers):
    return reduce(fractions.gcd, numbers) gcd_list
import fractions
from functools import reduce

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

N = int(input())
nums = [int(i) for i in input().split()]

print(gcd_list(nums))