local function getgcd(x, y)
  while 0 < x do
    x, y = y % x, x
  end
  return y
end
local n = io.read("*n")
local a = io.read("*n")
for i = 2, n do
  local b = io.read("*n")
  a = getgcd(a, b)
end
print(a)
