def gcd(a, b):

    while b:

        a, b = b, a % b

    return a





def gcd_n(numbers):

    ret = numbers[0]

    for i in range(len(numbers)):

        ret = gcd(ret, numbers[i])

    return ret





def main():

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

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

    print((gcd_n(x)))

    return





main()

def gcd(a, b):

    while b:

        a, b = b, a % b

    return a





def main():

    N, X, *xn = list(map(int, open(0).read().split()))

    ans = None

    for x in xn:

        if ans is not None:

            ans = gcd(ans, abs(X - x))

        else:

            ans = abs(X - xn[0])

    print(ans)

    return





main()

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


def gcd_n(numbers):
    ret = numbers[0]
    for i in range(len(numbers)):
        ret = gcd(ret, numbers[i])
    return ret


def main():
    N, X = list(map(int, input().split()))
    x = [abs(X - int(i)) for i in input().split()]
    print((gcd_n(x)))
    return


main()

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


def main():
    N, X, *xn = list(map(int, open(0).read().split()))
    ans = None
    for x in xn:
        if ans is not None:
            ans = gcd(ans, abs(X - x))
        else:
            ans = abs(X - xn[0])
    print(ans)
    return


main()

-def gcd_n(numbers): -    ret = numbers[0] -    for i in range(len(numbers)): -        ret = gcd(ret, numbers[i]) -    return ret - - -    N, X = list(map(int, input().split())) -    x = [abs(X - int(i)) for i in input().split()] -    print((gcd_n(x))) +    N, X, *xn = list(map(int, open(0).read().split())) +    ans = None +    for x in xn: +        if ans is not None: +            ans = gcd(ans, abs(X - x)) +        else: +            ans = abs(X - xn[0]) +    print(ans)