N = gets.to_i
As = gets.split.map(&:to_i)
target = As.sort
while (true) do
    tmp = []
    target[1..target.size].each{|x|
        n = x % target[0];
        tmp.push(n) if n != 0;
    }
    if tmp.size == 0
        ans = target[0]
        break;
    end
    target = tmp.push(target[0]).sort
end

puts ans
