import Data.List (foldl1')

solv x [v] = abs (v-x)
solv x xs
  = foldl1' gcd $ map (subtract x) xs

main = do
  [n,x] <- map read . words <$> getLine
  xs <- map read . words <$> getLine
  print $ solv x xs