import math from functools import reduce n = int(input()) nums = [int(i) for i in input().split()] def gcd(*numbers): return reduce(math.gcd, numbers) print(gcd(nums))