# from fractions import gcd

gcd = __import__("fractions").gcd



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

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

V.append(X)

V.sort()

vD = [V[i+1]-V[i] for i in range(len(V)-1)]

vD.sort()



res = vD[0]

for d in vD:

    res = gcd(res, d)

print(res)
# from fractions import gcd

# gcd = __import__("fractions").gcd



def gcd(a, b):

    if b == 0:

        return a

    return gcd(b, a%b)



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

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

V.append(X)

V.sort()

vD = [V[i+1]-V[i] for i in range(len(V)-1)]

vD.sort()



res = vD[0]

for d in vD:

    res = gcd(res, d)

    if res <= 1:

        break

print(res)
# from fractions import gcd
gcd = __import__("fractions").gcd
N, X = list(map(int, input().split()))
V = list(map(int, input().split()))
V.append(X)
V.sort()
vD = [V[i + 1] - V[i] for i in range(len(V) - 1)]
vD.sort()
res = vD[0]
for d in vD:
    res = gcd(res, d)
print(res)

# from fractions import gcd
# gcd = __import__("fractions").gcd
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


N, X = list(map(int, input().split()))
V = list(map(int, input().split()))
V.append(X)
V.sort()
vD = [V[i + 1] - V[i] for i in range(len(V) - 1)]
vD.sort()
res = vD[0]
for d in vD:
    res = gcd(res, d)
    if res <= 1:
        break
print(res)

-gcd = __import__("fractions").gcd +# gcd = __import__("fractions").gcd +def gcd(a, b): +    if b == 0: +        return a +    return gcd(b, a % b) + + +    if res <= 1: +        break