# coding: utf-8

try:

    from math import gcd

except:

    from fractions import gcd

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

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

x.append(X)

x.sort()

l = []

for i in range(N):

    tmp = (x[i+1] - x[i])

    if tmp != 0:

        l.append(tmp)

l.sort()

ans = l[0]

for i in range(1, len(l)):

    ans = gcd(ans, l[i])

print(ans)
# coding: utf-8

from fractions import gcd

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

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

ans = abs(A[0] - X)

for i in range(1, N):

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

print(ans)
# coding: utf-8
try:
    from math import gcd
except:
    from fractions import gcd
N, X = list(map(int, input().split()))
x = list(map(int, input().split()))
x.append(X)
x.sort()
l = []
for i in range(N):
    tmp = x[i + 1] - x[i]
    if tmp != 0:
        l.append(tmp)
l.sort()
ans = l[0]
for i in range(1, len(l)):
    ans = gcd(ans, l[i])
print(ans)

# coding: utf-8
from fractions import gcd

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

-try: -    from math import gcd -except: -    from fractions import gcd +from fractions import gcd + -x = list(map(int, input().split())) -x.append(X) -x.sort() -l = [] -for i in range(N): -    tmp = x[i + 1] - x[i] -    if tmp != 0: -        l.append(tmp) -l.sort() -ans = l[0] -for i in range(1, len(l)): -    ans = gcd(ans, l[i]) +A = list(map(int, input().split())) +ans = abs(A[0] - X) +for i in range(1, N): +    ans = gcd(ans, abs(A[i] - X))