function Main(input){
	input = input.split("\n");
	var mem = input[0].split(" ").map(Number);
	var arr = input[1].split(" ").map(Number);
	var p = Math.abs(mem[1]-arr[0]);
	for(var i=1;i<arr.length;i++){
		p = gcd(p,Math.abs(arr[i]-mem[1]))
	}
	function gcd(a, b) {
    if (b === 0){
        return a
    }
    return gcd(b, a % b)
}
console.log(p)
}Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());