main = do
    [_,x] <- ((fmap read . words) <$> getLine) :: IO [Int]
    xs <- (fmap (abs . subtract x . read) . words) <$> getLine
    print $ gcdL xs

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