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