from fractions import gcd

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

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

src.sort()



g = abs(X - src[0])

for a,b in zip(src,src[1:]):

    d = b-a

    g = gcd(g, d)

print(g)
from fractions import gcd



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

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



g = abs(X-src[0])

for x in src[1:]:

    g = gcd(g,abs(X-x))

print(g)
from fractions import gcd

N, X = list(map(int, input().split()))
src = list(map(int, input().split()))
src.sort()
g = abs(X - src[0])
for a, b in zip(src, src[1:]):
    d = b - a
    g = gcd(g, d)
print(g)

from fractions import gcd

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

-src.sort() -for a, b in zip(src, src[1:]): -    d = b - a -    g = gcd(g, d) +for x in src[1:]: +    g = gcd(g, abs(X - x))