def gcd(a, b):

    if b == 0:

        return a

    else:

        return gcd(b, a % b)





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

x = tuple(map(int, input().split()))



x = tuple([a - X for a in x])



xl = [-b for b in [a for a in x if a < 0]]

xr = [a for a in x if a >= 0]



g = 0

for xx in xl:

    g = gcd(g, xx)

for xx in xr:

    g = gcd(g, xx)

print(g)

from functools import reduce
def main():

    from functools import reduce



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

    A = (int(j) - X for j in input().split())



    def gcd(a, b):

        while b:

            a, b = b, a % b

        return a



    print((abs(reduce(gcd, A))))





if __name__ == '__main__':

    main()

def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a % b)


N, X = list(map(int, input().split()))
x = tuple(map(int, input().split()))
x = tuple([a - X for a in x])
xl = [-b for b in [a for a in x if a < 0]]
xr = [a for a in x if a >= 0]
g = 0
for xx in xl:
    g = gcd(g, xx)
for xx in xr:
    g = gcd(g, xx)
print(g)

from functools import reduce


def main():
    from functools import reduce

    N, X = list(map(int, input().split()))
    A = (int(j) - X for j in input().split())

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

    print((abs(reduce(gcd, A))))


if __name__ == "__main__":
    main()

-def gcd(a, b): -    if b == 0: -        return a -    else: -        return gcd(b, a % b) +from functools import reduce -N, X = list(map(int, input().split())) -x = tuple(map(int, input().split())) -x = tuple([a - X for a in x]) -xl = [-b for b in [a for a in x if a < 0]] -xr = [a for a in x if a >= 0] -g = 0 -for xx in xl: -    g = gcd(g, xx) -for xx in xr: -    g = gcd(g, xx) -print(g) +def main(): +    from functools import reduce + +    N, X = list(map(int, input().split())) +    A = (int(j) - X for j in input().split()) + +    def gcd(a, b): +        while b: +            a, b = b, a % b +        return a + +    print((abs(reduce(gcd, A)))) + + +if __name__ == "__main__": +    main()