from functools import reduce



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

d=[abs(x-X) for x in map(int,input().split())]



def gcd(a,b):

    while b:

        a, b = b, a % b

    return a



print((reduce(gcd,d)))
from fractions import gcd

from functools import reduce

_,X,*A=list(map(int,open(0).read().split()))

print((reduce(gcd,[abs(a-X)for a in A])))
from functools import reduce

N, X = list(map(int, input().split()))
d = [abs(x - X) for x in map(int, input().split())]


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


print((reduce(gcd, d)))

from fractions import gcd
from functools import reduce

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

+from fractions import gcd -N, X = list(map(int, input().split())) -d = [abs(x - X) for x in map(int, input().split())] - - -def gcd(a, b): -    while b: -        a, b = b, a % b -    return a - - -print((reduce(gcd, d))) +_, X, *A = list(map(int, open(0).read().split())) +print((reduce(gcd, [abs(a - X) for a in A])))