import fractions



n,x=list(map(int,input().split()))

X=list(map(int,input().split()))

X.append(x)

X=sorted(X)

Y=[X[i+1]-X[i] for i in range(n)]



if n==1:

  print((max(X)-min(X)))

  

else:

  gcd=fractions.gcd(Y[0],Y[1])

  for i in range(2,n):

    gcd=fractions.gcd(gcd,Y[i])

  print(gcd)
from fractions import gcd

from functools import reduce

n,x=list(map(int,input().split()))

X=list(map(int,input().split()))

Y=[abs(X[i]-x) for i in range(n)]

print((reduce(gcd,Y)))
import fractions

n, x = list(map(int, input().split()))
X = list(map(int, input().split()))
X.append(x)
X = sorted(X)
Y = [X[i + 1] - X[i] for i in range(n)]
if n == 1:
    print((max(X) - min(X)))
else:
    gcd = fractions.gcd(Y[0], Y[1])
    for i in range(2, n):
        gcd = fractions.gcd(gcd, Y[i])
    print(gcd)

from fractions import gcd
from functools import reduce

n, x = list(map(int, input().split()))
X = list(map(int, input().split()))
Y = [abs(X[i] - x) for i in range(n)]
print((reduce(gcd, Y)))

-import fractions +from fractions import gcd +from functools import reduce -X.append(x) -X = sorted(X) -Y = [X[i + 1] - X[i] for i in range(n)] -if n == 1: -    print((max(X) - min(X))) -else: -    gcd = fractions.gcd(Y[0], Y[1]) -    for i in range(2, n): -        gcd = fractions.gcd(gcd, Y[i]) -    print(gcd) +Y = [abs(X[i] - x) for i in range(n)] +print((reduce(gcd, Y)))