from fractions import gcd



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

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

y = list([abs(X - i) for i in x])

ans = y[0]

for i in range(1, N):

	ans = gcd(ans, y[i])

print(ans)

from fractions import gcd



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

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



ans = abs(x[0] - X)

for i in range(1, N):

    ans = gcd(ans, abs(x[i] - X))



print(ans)

from fractions import gcd

N, X = list(map(int, input().split()))
x = list(map(int, input().split()))
y = list([abs(X - i) for i in x])
ans = y[0]
for i in range(1, N):
    ans = gcd(ans, y[i])
print(ans)

from fractions import gcd

N, X = list(map(int, input().split()))
x = list(map(int, input().split()))
ans = abs(x[0] - X)
for i in range(1, N):
    ans = gcd(ans, abs(x[i] - X))
print(ans)

-y = list([abs(X - i) for i in x]) -ans = y[0] +ans = abs(x[0] - X) -    ans = gcd(ans, y[i]) +    ans = gcd(ans, abs(x[i] - X))