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

getInts :: IO [Int]
getInts = fmap (map (fst . fromJust . C8.readInt) . C8.words) C8.getLine

main :: IO ()
main = do
    [_, x] <- getInts
    xs     <- getInts
    print . foldl1 gcd . map (\y -> abs (y - x)) $ xs
