import Data.Char
import Data.List
import qualified Data.ByteString.Char8 as B
import qualified Data.Vector.Unboxed as V
import qualified Data.Vector.Algorithms.Intro as VA
main=print.solve.V.unfoldr(B.readInt.B.dropWhile isSpace)=<<B.getContents
solve=V.foldl1' gcd.(V.zipWith(-)=<<V.tail).V.modify VA.sort.V.tail