n = gets.to_i
hp = gets.split.map(&:to_i)
hp.sort!
ans = hp[0]
for i in 1..n-1
  k = ans
  l = hp[i]
  while k % l != 0 && l % k != 0
    if k > l
      k = k % l
    else
      l = l % k
    end
  end
  ans = [k,l].min
end
puts ans
