import sys

input = sys.stdin.readline



def gcd(a, b):

    while a > 0:

        if a < b:

            a, b = b, a

        a = a % b

    return b



def main():

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

    distance = (abs(x - int(y)) for y in input().split())



    res = next(distance)

    for d in distance:

        res = gcd(res, d)



    print(res)



if __name__ == "__main__":

    main()
import sys

input = sys.stdin.readline



def gcd(a, b):

    while a > 0:

        if a < b:

            a, b = b, a

        a = a % b

    return b



def main():

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

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



    distance = (abs(x-y) for y in town)

    res = next(distance)

    for d in distance:

        if d % res != 0:

            res = gcd(res, d)



    print(res)



if __name__ == "__main__":

    main()
import sys

input = sys.stdin.readline


def gcd(a, b):
    while a > 0:
        if a < b:
            a, b = b, a
        a = a % b
    return b


def main():
    n, x = list(map(int, input().split()))
    distance = (abs(x - int(y)) for y in input().split())
    res = next(distance)
    for d in distance:
        res = gcd(res, d)
    print(res)


if __name__ == "__main__":
    main()

import sys

input = sys.stdin.readline


def gcd(a, b):
    while a > 0:
        if a < b:
            a, b = b, a
        a = a % b
    return b


def main():
    n, x = list(map(int, input().split()))
    town = list(map(int, input().split()))
    distance = (abs(x - y) for y in town)
    res = next(distance)
    for d in distance:
        if d % res != 0:
            res = gcd(res, d)
    print(res)


if __name__ == "__main__":
    main()

-    distance = (abs(x - int(y)) for y in input().split()) +    town = list(map(int, input().split())) +    distance = (abs(x - y) for y in town) -        res = gcd(res, d) +        if d % res != 0: +            res = gcd(res, d)