from fractions import gcd

from functools import reduce



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

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



dist = [abs(y - X) for y in x]



print((reduce(gcd, dist)))
from fractions import gcd    # math.gcd in Python 3.5

from functools import reduce



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

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



dist = [abs(y - X) for y in x]



print((reduce(gcd, dist)))
from fractions import gcd
from functools import reduce

N, X = list(map(int, input().split()))
x = list(map(int, input().split()))
dist = [abs(y - X) for y in x]
print((reduce(gcd, dist)))

from fractions import gcd  # math.gcd in Python 3.5
from functools import reduce

N, X = list(map(int, input().split()))
x = list(map(int, input().split()))
dist = [abs(y - X) for y in x]
print((reduce(gcd, dist)))

-from fractions import gcd +from fractions import gcd  # math.gcd in Python 3.5