from functools import reduce

from fractions import gcd

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

x = [int(xi) for xi in input().split()]

x.append(X)

x = sorted(x)

diffs = [x[i+1] - x[i] for i in range(N)]

if len(diffs) == 1:

    print((diffs[0]))

else:

    print((reduce(gcd, diffs)))



from fractions import gcd

from functools import reduce

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

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

d = [abs(xi - X) for xi in x]

print((reduce(gcd, d)))
from functools import reduce
from fractions import gcd

N, X = list(map(int, input().split()))
x = [int(xi) for xi in input().split()]
x.append(X)
x = sorted(x)
diffs = [x[i + 1] - x[i] for i in range(N)]
if len(diffs) == 1:
    print((diffs[0]))
else:
    print((reduce(gcd, diffs)))

from fractions import gcd
from functools import reduce

N, X = list(map(int, input().split()))
x = list(map(int, input().split()))
d = [abs(xi - X) for xi in x]
print((reduce(gcd, d)))

+from fractions import gcd -from fractions import gcd -x = [int(xi) for xi in input().split()] -x.append(X) -x = sorted(x) -diffs = [x[i + 1] - x[i] for i in range(N)] -if len(diffs) == 1: -    print((diffs[0])) -else: -    print((reduce(gcd, diffs))) +x = list(map(int, input().split())) +d = [abs(xi - X) for xi in x] +print((reduce(gcd, d)))