function gcd(a,b)
    if b == 0 then
        return a
    else
        return gcd(b, a % b)
    end
end

function gcdmany(tbl)
    local ans = tbl[1]
    for i=2,#tbl do
        ans = gcd(ans, tbl[i])
    end
    return ans
end

local N, X = io.read("n", "n")
local x = {}
for i=1,N do
    x[i] = io.read("n")
end
table.insert(x, X)
table.sort(x)
local diffs = {}
for i=2,#x do
    table.insert(diffs, x[i] - x[i - 1])
end
local ans = gcdmany(diffs)
print(ans)
