#!/bin/ruby

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

(n-1).times do |i|
  a, b = [0, 0]
  if hps[i] < hps[i+1]
    b = hps[i+1]
    a = hps[i]
  else
    b = hps[i]
    a = hps[i+1]
  end

  ans = 0
  while true
    tmp = b % a
    if tmp == 0
      ans = a
      break
    else
      next_b = a
      next_a = b % a
      b = next_b
      a = next_a
    end
  end
  hps[i+1] = ans
end
puts hps[-1]


