from sys import stdin

from fractions import gcd

n, x, *xs = list(map(int, stdin.read().split()))

result = abs(xs[0] - x)

for i in range(1, n):

  result = gcd(result, abs(xs[i] - x))

print(result)

from sys import stdin

from fractions import gcd

from functools import reduce

n, x, *xs = list(map(int, stdin.read().split()))

print((reduce(gcd, [abs(xs[i] - x) for i in range(n)])))

from sys import stdin
from fractions import gcd

n, x, *xs = list(map(int, stdin.read().split()))
result = abs(xs[0] - x)
for i in range(1, n):
    result = gcd(result, abs(xs[i] - x))
print(result)

from sys import stdin
from fractions import gcd
from functools import reduce

n, x, *xs = list(map(int, stdin.read().split()))
print((reduce(gcd, [abs(xs[i] - x) for i in range(n)])))

+from functools import reduce -result = abs(xs[0] - x) -for i in range(1, n): -    result = gcd(result, abs(xs[i] - x)) -print(result) +print((reduce(gcd, [abs(xs[i] - x) for i in range(n)])))