import qualified Data.ByteString.Char8 as BS
import Data.Char
import Data.List

main = do
  li <- BS.getLine
  let [n,x] = unfoldr (BS.readInt . BS.dropWhile isSpace) li
  li <- BS.getLine
  let xs = unfoldr (BS.readInt . BS.dropWhile isSpace) li
  let ans = compute n x xs
  print ans

compute :: Int -> Int -> [Int] -> Int
compute n x xs = w
  where
    xs1 = sort (x:xs)
    w = foldl1' gcd $ zipWith subtract xs1 (tail xs1)
