n=gets.to_i
a=gets.split.map(&:to_i)
v=a.uniq
if v.length==1
    p a[0]
    exit
end

odd=0
even=0
result=[]
for i in 0..a.length-2
    first=a[i]
    second=a[i+1]
    
    result<<first.gcd(second)

end

p result.min