import fractions

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

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

distance = []

for i in range(N) :

    d = abs(x[i] - X)

    distance.append(d)

s = 1000000001

if N == 1 :

    s = distance[0]

else :

    for i in range(0,N-1) :

        s = min(fractions.gcd(distance[i],distance[i+1]),s)

print(s)
N,X = [int(i) for i in input().split()]

xa = [int(i) for i in input().split()]

from fractions import gcd

lia = [0]*N

for i in range(N):

    lia[i] = abs(X-xa[i])

ans = lia[0]

for i in range(1,N):

    ans = gcd(ans,lia[i])

print(ans)
import fractions

N, X = list(map(int, input().split()))
x = list(map(int, input().split()))
distance = []
for i in range(N):
    d = abs(x[i] - X)
    distance.append(d)
s = 1000000001
if N == 1:
    s = distance[0]
else:
    for i in range(0, N - 1):
        s = min(fractions.gcd(distance[i], distance[i + 1]), s)
print(s)

N, X = [int(i) for i in input().split()]
xa = [int(i) for i in input().split()]
from fractions import gcd

lia = [0] * N
for i in range(N):
    lia[i] = abs(X - xa[i])
ans = lia[0]
for i in range(1, N):
    ans = gcd(ans, lia[i])
print(ans)

-import fractions +N, X = [int(i) for i in input().split()] +xa = [int(i) for i in input().split()] +from fractions import gcd -N, X = list(map(int, input().split())) -x = list(map(int, input().split())) -distance = [] +lia = [0] * N -    d = abs(x[i] - X) -    distance.append(d) -s = 1000000001 -if N == 1: -    s = distance[0] -else: -    for i in range(0, N - 1): -        s = min(fractions.gcd(distance[i], distance[i + 1]), s) -print(s) +    lia[i] = abs(X - xa[i]) +ans = lia[0] +for i in range(1, N): +    ans = gcd(ans, lia[i]) +print(ans)