import Control.Arrow
import Data.List
import qualified Data.ByteString.Char8 as B

main :: IO ()
main = breads >>= main'
    where
        main' [_, x] = breads >>= print . solve x

-- |
-- >>> solve 3 [1, 77, 11]
-- 2
-- >>> solve 81 [33, 105, 57]
-- 24
-- >>> solve 1 [1000000000]
-- 999999999
solve :: Int -> [Int] -> Int 
solve a = foldl1' gcd . diff . sort . (a :)
    where
        diff (x : y : zs) = (y - x) : diff (y : zs)
        diff _ = []

breads :: IO [Int]
breads = unfoldr (\s -> second (maybe B.empty snd . B.uncons) <$> B.readInt s) <$> B.getLine