main = do
    [n,start] <- ((fmap read . words) <$> getLine) :: IO [Int]
    xs <- (((fmap read . words) <$> getLine) :: IO [Int])
    let list = map (subtract start) xs
    print $ gcdL list

gcdL :: [Int] -> Int
gcdL [x]    = x
gcdL (x:xs) = gcd x (gcdL xs) 