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