import Data.List
import Control.Monad

f2 ::[Int]->[Int]
f2 []=[]
f2 (x:[])=[x]
f2 (x:y:xs)=(y-x):f2 (y:xs)

main = do
       a<-getLine
       b<-getLine
       let (n:x:[])=map read . words $ a::[Int]
           xs=sort $ map read . words $ b::[Int]
           ys=f2 $ map (x - ) xs
       putStrLn $ show $ foldr1 (gcd) ys