import sys



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

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



def gcd(a, b):

	while b:

		a, b = b, a % b

	return a



if N==1:

    print((abs(X-x[0])))

    sys.exit()







x.append(X)

x.sort()



ANS=gcd(x[1]-x[0],x[2]-x[1])



for i in range(N):

    ANS=gcd(ANS,x[i+1]-x[i])



print(ANS)

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

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



def gcd(a, b):

	while b:

		a, b = b, a % b

	return a



s=abs(A[0]-X)

for i in range(1,N):

    s=gcd(s,abs(A[i]-X))



print(s)
import sys

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


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


if N == 1:
    print((abs(X - x[0])))
    sys.exit()
x.append(X)
x.sort()
ANS = gcd(x[1] - x[0], x[2] - x[1])
for i in range(N):
    ANS = gcd(ANS, x[i + 1] - x[i])
print(ANS)

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


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


s = abs(A[0] - X)
for i in range(1, N):
    s = gcd(s, abs(A[i] - X))
print(s)

-import sys - -x = list(map(int, input().split())) +A = list(map(int, input().split())) -if N == 1: -    print((abs(X - x[0]))) -    sys.exit() -x.append(X) -x.sort() -ANS = gcd(x[1] - x[0], x[2] - x[1]) -for i in range(N): -    ANS = gcd(ANS, x[i + 1] - x[i]) -print(ANS) +s = abs(A[0] - X) +for i in range(1, N): +    s = gcd(s, abs(A[i] - X)) +print(s)