def gcd(a, b):

    while a > 0:

        if a < b:

            a, b = b, a

        a = a % b

    return b



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

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



distance = (abs(x-y) for y in town)

res = next(distance)

for d in distance:

    res = gcd(res, d)



print(res)

def gcd(a, b):

    while a > 0:

        if a < b:

            a, b = b, a

        a = a % b

    return b



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

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



distance = (abs(x-y) for y in town)

res = next(distance)

for d in distance:

    if d % res != 0:

        res = gcd(res, d)



print(res)

def gcd(a, b):
    while a > 0:
        if a < b:
            a, b = b, a
        a = a % b
    return b


n, x = list(map(int, input().split()))
town = list(map(int, input().split()))
distance = (abs(x - y) for y in town)
res = next(distance)
for d in distance:
    res = gcd(res, d)
print(res)

def gcd(a, b):
    while a > 0:
        if a < b:
            a, b = b, a
        a = a % b
    return b


n, x = list(map(int, input().split()))
town = list(map(int, input().split()))
distance = (abs(x - y) for y in town)
res = next(distance)
for d in distance:
    if d % res != 0:
        res = gcd(res, d)
print(res)

-    res = gcd(res, d) +    if d % res != 0: +        res = gcd(res, d)