import Data.List(sort)

zipAdj :: [a] -> [(a, a)]
zipAdj x = zip x $ tail x

main = do
    [n, x] <- map read . words <$> getLine
    y <- map (read :: String -> Integer) . words <$> getLine
    putStrLn $ show $ foldr1 gcd $ fmap (uncurry $ flip (-)) $ zipAdj (sort $ x:y)
