def gcd(a,b):

    if b == 0:

        return a

    return gcd(b, a % b)





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

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

x.append(X)

x.sort()

x = [x[i]-x[0] for i in range(n+1)]

del x[0]

g = x[0]

for i in range(1, n):

    g = gcd(g,x[i])

print(g)

import math

from functools import reduce

import fractions





def gcd(*numbers):

    return reduce(fractions.gcd, numbers)





def gcd_list(numbers):

    return reduce(fractions.gcd, numbers)





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

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

dif = [abs(X - x[0])]



if N > 1:

    for i in range(N - 1):

        dif.append(x[i + 1] - x[i])

print((abs(gcd_list(dif))))

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


n, X = list(map(int, input().split()))
x = list(map(int, input().split()))
x.append(X)
x.sort()
x = [x[i] - x[0] for i in range(n + 1)]
del x[0]
g = x[0]
for i in range(1, n):
    g = gcd(g, x[i])
print(g)

import math
from functools import reduce
import fractions


def gcd(*numbers):
    return reduce(fractions.gcd, numbers)


def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)


N, X = list(map(int, input().split()))
x = list(map(int, input().split()))
dif = [abs(X - x[0])]
if N > 1:
    for i in range(N - 1):
        dif.append(x[i + 1] - x[i])
print((abs(gcd_list(dif))))

-def gcd(a, b): -    if b == 0: -        return a -    return gcd(b, a % b) +import math +from functools import reduce +import fractions -n, X = list(map(int, input().split())) +def gcd(*numbers): +    return reduce(fractions.gcd, numbers) + + +def gcd_list(numbers): +    return reduce(fractions.gcd, numbers) + + +N, X = list(map(int, input().split())) -x.append(X) -x.sort() -x = [x[i] - x[0] for i in range(n + 1)] -del x[0] -g = x[0] -for i in range(1, n): -    g = gcd(g, x[i]) -print(g) +dif = [abs(X - x[0])] +if N > 1: +    for i in range(N - 1): +        dif.append(x[i + 1] - x[i]) +print((abs(gcd_list(dif))))