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