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

main = do
    [n,x] <- map read . words <$> getLine
    xs <- VU.map (\a -> abs $ x - a) . VU.unfoldrN n (B.readInt . B.dropWhile isSpace) <$> B.getLine
    print $ VU.foldl1' gcd xs