local function getgcd(x, y)
  while(0 < x and 0 < y) do
    if(x < y) then y = y % x else x = x % y end
  end
  return math.max(x, y)
end
local n = io.read("*n")
local gcd = io.read("*n")
for i = 2, n do
  local a = io.read("*n")
  gcd = getgcd(gcd, a)
end
print(gcd)
