import math

from fractions import gcd

from functools import reduce

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

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

y_ls.sort()

d_ls = [0] * (n-1)



if n != 1:

    first_ls = []

    for i in range(n):

        first = abs(x - y_ls[i])

        first_ls.append(first)



    for i in range(n-1):

        distance = y_ls[i+1] - y_ls[i] 

        d_ls.append(distance)



    points_gcd = reduce(gcd, d_ls)

    ans = 0

    for i in range(n):

        D = gcd(points_gcd, first_ls[i])

        if D > ans:

            ans = D



else:

    ans = abs(x - y_ls[0])



print(ans)

from math import gcd

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

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

diff_ls = [0] * n



for i in range(n):

    diff_ls[i] = abs(start-x_ls[i])



ans = diff_ls[0]

for i in range(1,n):

    ans = gcd(ans,diff_ls[i])



print(ans)
import math
from fractions import gcd
from functools import reduce

n, x = list(map(int, input().split()))
y_ls = list(map(int, input().split()))
y_ls.sort()
d_ls = [0] * (n - 1)
if n != 1:
    first_ls = []
    for i in range(n):
        first = abs(x - y_ls[i])
        first_ls.append(first)
    for i in range(n - 1):
        distance = y_ls[i + 1] - y_ls[i]
        d_ls.append(distance)
    points_gcd = reduce(gcd, d_ls)
    ans = 0
    for i in range(n):
        D = gcd(points_gcd, first_ls[i])
        if D > ans:
            ans = D
else:
    ans = abs(x - y_ls[0])
print(ans)

from math import gcd

n, start = list(map(int, input().split()))
x_ls = list(map(int, input().split()))
diff_ls = [0] * n
for i in range(n):
    diff_ls[i] = abs(start - x_ls[i])
ans = diff_ls[0]
for i in range(1, n):
    ans = gcd(ans, diff_ls[i])
print(ans)

-import math -from fractions import gcd -from functools import reduce +from math import gcd -n, x = list(map(int, input().split())) -y_ls = list(map(int, input().split())) -y_ls.sort() -d_ls = [0] * (n - 1) -if n != 1: -    first_ls = [] -    for i in range(n): -        first = abs(x - y_ls[i]) -        first_ls.append(first) -    for i in range(n - 1): -        distance = y_ls[i + 1] - y_ls[i] -        d_ls.append(distance) -    points_gcd = reduce(gcd, d_ls) -    ans = 0 -    for i in range(n): -        D = gcd(points_gcd, first_ls[i]) -        if D > ans: -            ans = D -else: -    ans = abs(x - y_ls[0]) +n, start = list(map(int, input().split())) +x_ls = list(map(int, input().split())) +diff_ls = [0] * n +for i in range(n): +    diff_ls[i] = abs(start - x_ls[i]) +ans = diff_ls[0] +for i in range(1, n): +    ans = gcd(ans, diff_ls[i])