require 'pp'
require 'set'
N = readline.chomp.to_i
A = readline.chomp.split.map(&:to_i)

a = Set.new(A)
min = a.min

while a.size != 1
  #pp a,min
  a0 = min
  a.map! do |x|
    mod = (x % a0)
    min = mod if mod > 0 and mod < min
    mod
  end
  a.delete_if {|x| x == 0 }
  a.add(a0)
end
puts a.to_a.first
