import Control.Monad
import Data.List
import qualified Data.ByteString.Char8 as B

main = do
    (n:x:_)<-map read.words<$>getLine::IO[Int]
    xs<-sort.(x:).unfoldr (B.readInt.B.dropWhile(==' '))<$>B.getLine::IO[Int]
    print $ gcds $ dff [] xs
--
dff ac [_] = ac
dff ac (x:y:r) = dff ((y-x):ac) (y:r)
--
gcds [x] = x
gcds (a:ys) = gcd a $ gcds ys