from fractions import gcd

from functools import reduce



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

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

assert len(x) == N



x.sort()



# distance between each two cities

dist = [x[i] - x[i-1] for i in range(1, len(x))]



# distance between the first city and the start point

dist.append(abs(x[0] - X))



print((reduce(gcd, dist)))

from fractions import gcd

from functools import reduce



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

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

assert len(x) == N



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



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

N, X = list(map(int, input().split()))
x = list(map(int, input().split()))
assert len(x) == N
x.sort()
# distance between each two cities
dist = [x[i] - x[i - 1] for i in range(1, len(x))]
# distance between the first city and the start point
dist.append(abs(x[0] - X))
print((reduce(gcd, dist)))

from fractions import gcd
from functools import reduce

N, X = list(map(int, input().split()))
x = list(map(int, input().split()))
assert len(x) == N
dist = [abs(y - X) for y in x]
print((reduce(gcd, dist)))

-x.sort() -# distance between each two cities -dist = [x[i] - x[i - 1] for i in range(1, len(x))] -# distance between the first city and the start point -dist.append(abs(x[0] - X)) +dist = [abs(y - X) for y in x]