def nl(): return list(map(int, input().split()))

def gcd(x, y):

    if x < y:

        # x >= y とする

        x, y = y, x

    while True:

        r = x % y

        if r == 0:

            break

        else:

            x, y = y, r

    return y



N, X = nl()

x = nl()

x2 = list(map(abs, ([v - X for v in x])))



g = x2[0]

for i in range(1, N):

    g = gcd(g, x2[i])

print(g)
def gcd(x, y):

    if x < y:# x >= y とする

        x, y = y, x

    r = x % y

    res = y if r == 0 else gcd(y, r) 

    return res



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

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

x2 = [abs(i - X) for i in x]



g = x2[0]

for i in x2:

    g = gcd(g, i)

print(g)
def nl():
    return list(map(int, input().split()))


def gcd(x, y):
    if x < y:
        # x >= y とする
        x, y = y, x
    while True:
        r = x % y
        if r == 0:
            break
        else:
            x, y = y, r
    return y


N, X = nl()
x = nl()
x2 = list(map(abs, ([v - X for v in x])))
g = x2[0]
for i in range(1, N):
    g = gcd(g, x2[i])
print(g)

def gcd(x, y):
    if x < y:  # x >= y とする
        x, y = y, x
    r = x % y
    res = y if r == 0 else gcd(y, r)
    return res


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

-def nl(): -    return list(map(int, input().split())) +def gcd(x, y): +    if x < y:  # x >= y とする +        x, y = y, x +    r = x % y +    res = y if r == 0 else gcd(y, r) +    return res -def gcd(x, y): -    if x < y: -        # x >= y とする -        x, y = y, x -    while True: -        r = x % y -        if r == 0: -            break -        else: -            x, y = y, r -    return y - - -N, X = nl() -x = nl() -x2 = list(map(abs, ([v - X for v in x]))) +N, X = list(map(int, input().split())) +x = list(map(int, input().split())) +x2 = [abs(i - X) for i in x] -for i in range(1, N): -    g = gcd(g, x2[i]) +for i in x2: +    g = gcd(g, i)