from fractions import gcd

from functools import reduce

X=int(input().split()[1]);print((reduce(gcd,[abs(int(x)-X) for x in input().split()])))
from fractions import gcd

from functools import reduce

_,X,*y=list(map(int,open(0).read().split()));print((reduce(gcd,[abs(x-X)for x in y])))
from fractions import gcd
from functools import reduce

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

from fractions import gcd
from functools import reduce

_, X, *y = list(map(int, open(0).read().split()))
print((reduce(gcd, [abs(x - X) for x in y])))

-X = int(input().split()[1]) -print((reduce(gcd, [abs(int(x) - X) for x in input().split()]))) +_, X, *y = list(map(int, open(0).read().split())) +print((reduce(gcd, [abs(x - X) for x in y])))