n = gets
hps = gets.chomp.split.map(&:to_i)

ans = hps.min
flag = true

while flag
  mods = hps.map{|e| e%ans}
  mods_wo_zero = mods.select{|e| e>0}
  if !mods_wo_zero.empty? && mods_wo_zero.min != ans
    ans = mods_wo_zero.min
    hps.map!.with_index{|e, i| (mods[i]).zero? ? e : mods[i]}
  else
    flag = false
  end
end

puts ans
