import Control.Monad
import Data.List

main = do
    [n, x] <- map read <$> words <$> getLine
    xs     <- map read <$> words <$> getLine
    putStrLn $ show $ solve x xs

solve :: Int -> [Int] -> Int
solve x xs = foldl1 gcd $ map (abs . (-) x) xs