import fractions



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

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

assert len(x) == N



x.sort()



# distance between each two cities

dist = [x[i] - x[i-1] for i in range(1, len(x))]



# distance between the first city and the start point

dist.append(abs(x[0] - X))



def listgcd(xs):

    g = xs[0]

    for i in range(1, len(xs)):

        g = fractions.gcd(g, xs[i])

    return g



print((listgcd(dist)))

from fractions import gcd

from functools import reduce



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

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

assert len(x) == N



x.sort()



# distance between each two cities

dist = [x[i] - x[i-1] for i in range(1, len(x))]



# distance between the first city and the start point

dist.append(abs(x[0] - X))



print((reduce(gcd, dist)))

import fractions

N, X = list(map(int, input().split()))
x = list(map(int, input().split()))
assert len(x) == N
x.sort()
# distance between each two cities
dist = [x[i] - x[i - 1] for i in range(1, len(x))]
# distance between the first city and the start point
dist.append(abs(x[0] - X))


def listgcd(xs):
    g = xs[0]
    for i in range(1, len(xs)):
        g = fractions.gcd(g, xs[i])
    return g


print((listgcd(dist)))

from fractions import gcd
from functools import reduce

N, X = list(map(int, input().split()))
x = list(map(int, input().split()))
assert len(x) == N
x.sort()
# distance between each two cities
dist = [x[i] - x[i - 1] for i in range(1, len(x))]
# distance between the first city and the start point
dist.append(abs(x[0] - X))
print((reduce(gcd, dist)))

-import fractions +from fractions import gcd +from functools import reduce - - -def listgcd(xs): -    g = xs[0] -    for i in range(1, len(xs)): -        g = fractions.gcd(g, xs[i]) -    return g - - -print((listgcd(dist))) +print((reduce(gcd, dist)))