local n, k = io.read("*n", "*n")
local function getgcd(x, y)
  while(0 < y) do
    x, y = y, x % y
  end
  return x
end
local gcd = 0
for i = 1, n do
  local t = math.abs(k - io.read("*n"))
  if(t ~= 0) then
    if(gcd == 0) then gcd = t else gcd = getgcd(gcd, t) end
  end
end
print(gcd)
