import fractions

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

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

l = []

for _x in x:

        l.append(abs(_x - X))

gcd = l[0]

for i in range(1, n):

    gcd = fractions.gcd(gcd, l[i])

print(gcd)
import fractions

def GCD(a):

    gcd = a[0]

    N = len(a)

    for i in range(1, N):

        gcd = fractions.gcd(gcd, a[i])

    return gcd



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

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



if len(x) == 1:

    print((abs(x[0] - X)))

    exit()



x.append(X)

x.sort()



ans = float("inf")

d = []

for i in range(N):

    d.append(x[i+1] - x[i])



ans = GCD(d)

print(ans)
import fractions

n, X = list(map(int, input().split()))
x = list(map(int, input().split()))
l = []
for _x in x:
    l.append(abs(_x - X))
gcd = l[0]
for i in range(1, n):
    gcd = fractions.gcd(gcd, l[i])
print(gcd)

import fractions


def GCD(a):
    gcd = a[0]
    N = len(a)
    for i in range(1, N):
        gcd = fractions.gcd(gcd, a[i])
    return gcd


N, X = list(map(int, input().split()))
x = list(map(int, input().split()))
if len(x) == 1:
    print((abs(x[0] - X)))
    exit()
x.append(X)
x.sort()
ans = float("inf")
d = []
for i in range(N):
    d.append(x[i + 1] - x[i])
ans = GCD(d)
print(ans)

-n, X = list(map(int, input().split())) + +def GCD(a): +    gcd = a[0] +    N = len(a) +    for i in range(1, N): +        gcd = fractions.gcd(gcd, a[i]) +    return gcd + + +N, X = list(map(int, input().split())) -l = [] -for _x in x: -    l.append(abs(_x - X)) -gcd = l[0] -for i in range(1, n): -    gcd = fractions.gcd(gcd, l[i]) -print(gcd) +if len(x) == 1: +    print((abs(x[0] - X))) +    exit() +x.append(X) +x.sort() +ans = float("inf") +d = [] +for i in range(N): +    d.append(x[i + 1] - x[i]) +ans = GCD(d) +print(ans)