lines = []
while line = gets
    lines << line.chomp.split(' ').map(&:to_i)
end

N = lines[0][0]
Inf = 10 ** 10

hp = lines[1].sort!
min = hp[0]

for i in 1..35 do
  next_min = Inf
  for j in 1..N do
    rest = hp[j-1] % min
    if rest != 0 then
      hp[j-1] = rest
    end
    if next_min > hp[j-1] then
      next_min = hp[j-1]
    end
  end
  min = next_min
end
    
puts min