import fractions

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

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

x.sort()

a = []

for i in range(N):

    a.append(abs(X - x[i]))

ans = a[0]

if len(a) > 1:

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

        ans = fractions.gcd(ans, a[i])

print(ans)
from functools import reduce

from fractions import gcd

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

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



n = []

for i in range(N):

    n.append(abs(X - x[i]))

print((reduce(gcd, n)))
import fractions

N, X = list(map(int, input().split()))
x = list(map(int, input().split()))
x.sort()
a = []
for i in range(N):
    a.append(abs(X - x[i]))
ans = a[0]
if len(a) > 1:
    for i in range(1, len(a)):
        ans = fractions.gcd(ans, a[i])
print(ans)

from functools import reduce
from fractions import gcd

N, X = list(map(int, input().split()))
x = list(map(int, input().split()))
n = []
for i in range(N):
    n.append(abs(X - x[i]))
print((reduce(gcd, n)))

-import fractions +from functools import reduce +from fractions import gcd -x.sort() -a = [] +n = [] -    a.append(abs(X - x[i])) -ans = a[0] -if len(a) > 1: -    for i in range(1, len(a)): -        ans = fractions.gcd(ans, a[i]) -print(ans) +    n.append(abs(X - x[i])) +print((reduce(gcd, n)))