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

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



x_min = min(x)



for i in range(x_min, 0, -1):

    cnt = 0

    for j in x:

        if j % i != 0:

            break

        else:

            cnt += 1

    if cnt == N:

        print(i)

        exit()
from fractions import gcd



def main():

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

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



    M = x[0]



    for i in x[1:]:

        M = gcd(M, i)



    print(M)



if __name__ == "__main__":

    main()
N, X = list(map(int, input().split()))
x = list([abs(int(i) - X) for i in input().split()])
x_min = min(x)
for i in range(x_min, 0, -1):
    cnt = 0
    for j in x:
        if j % i != 0:
            break
        else:
            cnt += 1
    if cnt == N:
        print(i)
        exit()

from fractions import gcd


def main():
    n, X = list(map(int, input().split()))
    x = list([abs(int(x) - X) for x in input().split()])
    M = x[0]
    for i in x[1:]:
        M = gcd(M, i)
    print(M)


if __name__ == "__main__":
    main()

-N, X = list(map(int, input().split())) -x = list([abs(int(i) - X) for i in input().split()]) -x_min = min(x) -for i in range(x_min, 0, -1): -    cnt = 0 -    for j in x: -        if j % i != 0: -            break -        else: -            cnt += 1 -    if cnt == N: -        print(i) -        exit() +from fractions import gcd + + +def main(): +    n, X = list(map(int, input().split())) +    x = list([abs(int(x) - X) for x in input().split()]) +    M = x[0] +    for i in x[1:]: +        M = gcd(M, i) +    print(M) + + +if __name__ == "__main__": +    main()