N=io.read("n")
X=io.read("n")
x={}
for i=1,N do
  x[i]=io.read("n")
end
h={}
for i=1,N do
  h[i]=X-x[i] 
  if h[i]<0 then
    h[i]=-h[i]
  end
end
table.sort(h)
res=1
for i=h[1],1,-1 do
  for j=1,N do
    if h[j]%i~=0 then 
      res=0
      break
    end
  end
  if res==1 then
    print(i)
    break
  end
end