main :: IO()
main = do
  sx:sxs:_ <- lines <$> getContents
  let x = (read $ last $ words sx) in
    let xs  = (map (\y -> abs((x::Int) - ((read y):: Int)) :: Int) $ words sxs) :: [Int] in
      putStrLn $ show $ foldl1 gcd xs
