from fractions import gcd



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

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

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

ans = z[0]

for i in range(1, N):

	ans = gcd(ans, z[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 el in x[1:]:

    ans = gcd(ans, abs(el - X))

print(ans)

from fractions import gcd

N, X = list(map(int, input().split()))
x = list(map(int, input().split()))
z = list([abs(X - i) for i in x])
ans = z[0]
for i in range(1, N):
    ans = gcd(ans, z[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 el in x[1:]:
    ans = gcd(ans, abs(el - X))
print(ans)

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