import qualified Data.ByteString.Char8 as BC
import Data.Maybe

readIntsLine :: IO [Int]
readIntsLine = map (fst . fromJust . BC.readInt) . BC.words <$> BC.getLine

main :: IO ()
main = do
  [n, x] <- readIntsLine
  xs <- map (\a -> abs $ a - x) <$> readIntsLine
  print $ foldr gcd (head xs) (tail xs)