implicit none
integer :: n,x0
integer,allocatable :: x(:)
integer :: i,p,q,r,gcd

read *,n,x0
allocate(x(n))
read *,(x(i),i=1,n)

do i = 1, n
   x(i) = abs(x(i) - x0)
enddo

gcd = x(1)
do i = 2, n
   p = min(gcd,x(i))
   q = max(gcd,x(i))
   
   r = 1
   do while (r > 0)
      r = mod(q,p)
      q = p
      p = r
   enddo
   
   gcd = q
enddo

write(*,'(i0)') gcd
end