function gcd(a,b)
  if a<b then
    return gcd(b,a)
  elseif a%b==0 then
    return b
  else
    return gcd(b,a%b)
  end
end
n=io.read():match("%d+")
for i in io.read():gmatch("%d+") do
  if ans==nil then
    ans=i*1
  end
  ans=gcd(ans,i*1)
end
print(string.format("%d",ans))