# abc109_c





def mcd(x, y):

    if x > y:

        big = x

        small = y

    else:

        big = y

        small = x

    while True:

        rest = big % small

        if rest == 0:

            return small

        else:

            big = small

            small = rest





def solve(seq):

    satisfy = []  # find distances to satisfy

    for i in range(len(seq) - 1):

        satisfy.append(abs(seq[i] - seq[i + 1]))

    # print(satisfy)



    if len(satisfy) == 1:

        return satisfy[0]



    mcds = []

    for i in range(len(satisfy) - 1):

        mcds.append(mcd(satisfy[i], satisfy[i + 1]))

    # print(sol)



    return min(mcds)





if __name__ == "__main__":

    firstline_input = list(map(int, input("").split(" ")))

    seq = list(map(int, input("").split(" ")))

    seq.insert(0, firstline_input[1])

    print((solve(seq)))

# abc109_c



from functools import reduce





def mcd(x, y):

    if x > y:

        big = x

        small = y

    else:

        big = y

        small = x

    while True:

        rest = big % small

        if rest == 0:

            return small

        else:

            big = small

            small = rest





def solve(seq):

    satisfy = []  # find distances to satisfy

    for i in range(len(seq) - 1):

        satisfy.append(abs(seq[i] - seq[i + 1]))



    if len(satisfy) == 1:

        return satisfy[0]



    return reduce(mcd, satisfy)





if __name__ == "__main__":

    firstline_input = list(map(int, input("").split(" ")))

    seq = list(map(int, input("").split(" ")))

    seq.insert(0, firstline_input[1])

    print((solve(seq)))

# abc109_c
def mcd(x, y):
    if x > y:
        big = x
        small = y
    else:
        big = y
        small = x
    while True:
        rest = big % small
        if rest == 0:
            return small
        else:
            big = small
            small = rest


def solve(seq):
    satisfy = []  # find distances to satisfy
    for i in range(len(seq) - 1):
        satisfy.append(abs(seq[i] - seq[i + 1]))
    # print(satisfy)
    if len(satisfy) == 1:
        return satisfy[0]
    mcds = []
    for i in range(len(satisfy) - 1):
        mcds.append(mcd(satisfy[i], satisfy[i + 1]))
    # print(sol)
    return min(mcds)


if __name__ == "__main__":
    firstline_input = list(map(int, input("").split(" ")))
    seq = list(map(int, input("").split(" ")))
    seq.insert(0, firstline_input[1])
    print((solve(seq)))

# abc109_c
from functools import reduce


def mcd(x, y):
    if x > y:
        big = x
        small = y
    else:
        big = y
        small = x
    while True:
        rest = big % small
        if rest == 0:
            return small
        else:
            big = small
            small = rest


def solve(seq):
    satisfy = []  # find distances to satisfy
    for i in range(len(seq) - 1):
        satisfy.append(abs(seq[i] - seq[i + 1]))
    if len(satisfy) == 1:
        return satisfy[0]
    return reduce(mcd, satisfy)


if __name__ == "__main__":
    firstline_input = list(map(int, input("").split(" ")))
    seq = list(map(int, input("").split(" ")))
    seq.insert(0, firstline_input[1])
    print((solve(seq)))

+from functools import reduce + + -    # print(satisfy) -    mcds = [] -    for i in range(len(satisfy) - 1): -        mcds.append(mcd(satisfy[i], satisfy[i + 1])) -    # print(sol) -    return min(mcds) +    return reduce(mcd, satisfy)