input = gets.chomp
N = input.to_i
input = gets.chomp
monster_list = input.split(" ").map{|e| e.to_i}

loop {
  monster_list.sort!
  atacker = monster_list.shift
  monster_list.delete_if { |e| e%atacker == 0 }
  if monster_list.size==0
    monster_list << atacker
  end
  monster_list.sort!
  monster_list[0] -= atacker*(monster_list[0]/atacker)
  monster_list.delete_at(0) if monster_list[0] == 0
  monster_list << atacker
  break if monster_list.size==1
}
puts monster_list.first
