import qualified Data.Vector.Unboxed as VU
import qualified Data.ByteString.Char8 as B
import Data.Char
import Data.List

main = do
    [n,x] <- map read . words <$> getLine
    xs <- sort . (x:) . VU.toList . VU.unfoldrN n (B.readInt . B.dropWhile isSpace) <$> B.getLine :: IO [Int]
    let xs' = map snd $ drop 2 $ scanl' (\(prev, _) x -> (x, abs $ prev - x)) (0, 0) xs :: [Int]
    print $ foldl1' gcd xs'