import Data.List

difs :: [Int] -> [Int]
difs []  = []
difs [x] = []
difs (x:y:xs) = (abs (x-y)) : difs (y:xs)

main :: IO ()
main = do
  [n,x] <- map read <$> words <$> getLine
  l     <- map read <$> words <$> getLine
  let nums = insert x $ sort l
  putStrLn $ show $ foldr1 gcd $ difs nums
