from fractions import gcd



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

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

P.append(X)

P.sort()

x0 = P[0]

P = [x - x0 for x in P]

ans = 0

for x in P:

    ans = gcd(ans, x)



print(ans)

from fractions import gcd



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

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

x0 = min(min(P), X)

P = [x - x0 for x in P]

ans = X - x0

for x in P:

    ans = gcd(ans, x)



print(ans)

from fractions import gcd

N, X = list(map(int, input().split()))
P = list(map(int, input().split()))
P.append(X)
P.sort()
x0 = P[0]
P = [x - x0 for x in P]
ans = 0
for x in P:
    ans = gcd(ans, x)
print(ans)

from fractions import gcd

N, X = list(map(int, input().split()))
P = list(map(int, input().split()))
x0 = min(min(P), X)
P = [x - x0 for x in P]
ans = X - x0
for x in P:
    ans = gcd(ans, x)
print(ans)

-P.append(X) -P.sort() -x0 = P[0] +x0 = min(min(P), X) -ans = 0 +ans = X - x0