from functools import reduce
from math import gcd

n = int(input())
a = list(map(int,input().split()))
g = reduce(gcd,a)
print(g) from functools import reduce from math import gcd 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 g = reduce(gcd,a) g reduce(gcd,a) reduce gcd a print(g) print g a = list(map(int,input().split())) list(map(int,input().split())) a g = reduce(gcd,a) reduce(gcd,a) g n = int(input()) int(input()) n
from functools import reduce
from math import gcd

n = int(input())
a = list(map(int,input().split()))
g = reduce(gcd,a)
print(g)