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