solver::[Int]->Int->Int
solver coords init_pos = let d = (map (\x -> abs (init_pos - x)) coords) in
                         foldl gcd (head d) (tail d)

main::IO()
main=do
  nxc<-getLine
  let n:x:[]= map read (words nxc)::[Int]
  d<-getLine
  let dat = map read (words d) ::[Int]
  print (solver dat x)
