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

n,x=io.read("*n","*n")
d=0
for i=1,n do
    y=math.abs(x-io.read("*n"))
    if y>0 then
        if d==0 then
            d=y
        else
            d=gcd(y,d)
        end
    end
end
print(d)