import fractions

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

idx = [abs(int(i) - x) for i in input().split()]

ans = idx[0]

if n == 1: pass

else:

    for i in range(1, n):

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

print(ans)
import fractions

from functools import reduce

gcd = lambda l: reduce(fractions.gcd, l)

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

c = [abs(x-int(i)) for i in input().split()]

print((gcd(c)))
import fractions

n, x = list(map(int, input().split()))
idx = [abs(int(i) - x) for i in input().split()]
ans = idx[0]
if n == 1:
    pass
else:
    for i in range(1, n):
        ans = fractions.gcd(ans, idx[i])
print(ans)

import fractions
from functools import reduce

gcd = lambda l: reduce(fractions.gcd, l)
n, x = list(map(int, input().split()))
c = [abs(x - int(i)) for i in input().split()]
print((gcd(c)))

+from functools import reduce +gcd = lambda l: reduce(fractions.gcd, l) -idx = [abs(int(i) - x) for i in input().split()] -ans = idx[0] -if n == 1: -    pass -else: -    for i in range(1, n): -        ans = fractions.gcd(ans, idx[i]) -print(ans) +c = [abs(x - int(i)) for i in input().split()] +print((gcd(c)))