N = gets.to_i
As = gets.split.map(&:to_i)

def attack(arr)
  new_arr = []

  min = arr.min #1

  new_arr.push(min) #[1]

  arr.each do |i|
    next if min == i
    new_arr.push(i.modulo(min)) if i.modulo(min) != 0
  end
  
  return new_arr[0] if new_arr.length == 1

  return attack(new_arr)
end

puts attack(As)