def gcd(x, y):

    if y == 0:

        return x

    else:

        return gcd(y, x % y) 



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

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

if len(x) == 1:

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

else:

  x.sort()

  s = x[1] - x[0]

  for i in range(1, n-1):

    s = gcd(s, x[i+1]-x[i])

  a = 1

  for i in range(n):

    a = max(a, gcd(abs(X-x[i]), s))

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

    if y == 0:

        return x

    else:

        return gcd(y, x % y) 



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

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

a = abs(x[0] - X)

for i in x[1:]:

  a = gcd(a, abs(i - X))

print(a)
def gcd(x, y):
    if y == 0:
        return x
    else:
        return gcd(y, x % y)


n, X = list(map(int, input().split()))
x = list(map(int, input().split()))
if len(x) == 1:
    print((abs(x[0] - X)))
else:
    x.sort()
    s = x[1] - x[0]
    for i in range(1, n - 1):
        s = gcd(s, x[i + 1] - x[i])
    a = 1
    for i in range(n):
        a = max(a, gcd(abs(X - x[i]), s))
    print(a)

def gcd(x, y):
    if y == 0:
        return x
    else:
        return gcd(y, x % y)


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

-if len(x) == 1: -    print((abs(x[0] - X))) -else: -    x.sort() -    s = x[1] - x[0] -    for i in range(1, n - 1): -        s = gcd(s, x[i + 1] - x[i]) -    a = 1 -    for i in range(n): -        a = max(a, gcd(abs(X - x[i]), s)) -    print(a) +a = abs(x[0] - X) +for i in x[1:]: +    a = gcd(a, abs(i - X)) +print(a)