integer(16) N,X,ans,i
integer(16),allocatable,dimension(:)::Y,K
read*,N,X
allocate(Y(N),K(N))
read*,Y
do i=1,N
  K(i)=abs(Y(i)-X)
end do
ans=K(1)
do i=2,N
  ans=gcd(ans,K(I))
end do
print"(i0)",ans
contains
pure function gcd(a,b)
integer(16),intent(in)::a,b
integer(16) gcd
integer(16)s,t
s=a
gcd=b

t=mod(s,gcd)
do while(t/=0)
  s=gcd
  gcd=t
  t=mod(s,gcd)
end do
end function gcd
end