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

x=sorted([abs(int(x)-X) for x in input().split()])

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

    if x[0]%i:continue

    if sum([x%i for x in x])==0:

        print(i)

        break
from functools import reduce

def g(a,b):

  while b:a,b=b,a%b

  return a

def f(x):return reduce(g,x)

X=int(input().split()[1]);print((f([abs(int(x)-X) for x in input().split()])))
N, X = list(map(int, input().split()))
x = sorted([abs(int(x) - X) for x in input().split()])
for i in range(x[0] + 1)[::-1]:
    if x[0] % i:
        continue
    if sum([x % i for x in x]) == 0:
        print(i)
        break

from functools import reduce


def g(a, b):
    while b:
        a, b = b, a % b
    return a


def f(x):
    return reduce(g, x)


X = int(input().split()[1])
print((f([abs(int(x) - X) for x in input().split()])))

-N, X = list(map(int, input().split())) -x = sorted([abs(int(x) - X) for x in input().split()]) -for i in range(x[0] + 1)[::-1]: -    if x[0] % i: -        continue -    if sum([x % i for x in x]) == 0: -        print(i) -        break +from functools import reduce + + +def g(a, b): +    while b: +        a, b = b, a % b +    return a + + +def f(x): +    return reduce(g, x) + + +X = int(input().split()[1]) +print((f([abs(int(x) - X) for x in input().split()])))