// parameter "input" gets all data
function Main(input) {
	// the first line is assigned to input[0], the second line is assigned to input[1] similarly.
	
	input = input.split("\n").map((s)=>s.trim());
	var n = parseInt(input[0].split(' ')[0]);
	var x = parseInt(input[0].split(' ')[1]);
	var y = input[1].split(" ").map((s)=>Math.abs(parseInt(s.trim())-x));

	var m = -1;
	for (var i = 0; i < y.length; i++) {
		if(m==-1)
			m=y[0];
		else
			m=Math.min(y[i],m);
	}
	var yy = y.filter((_y)=>_y%m!=0);
	yy.push(m);
	if(yy.length==1){
		console.log(yy[0]);
		return;
	}else{
		for (var a = m; a > 1; a--) {
			if(m%a==0){
				var found = true;
				for (var i = 0; i < yy.length; i++) {
					if(yy[i]%a!=0){
						found = false;
						break;
					}
				}
				if(found){
					console.log(a);
					return;
				}
			}
		}
	}
	console.log(1);
}
// Don't edit this line!
//Main(require("fs").readFileSync(__dirname+'/in.txt', "utf8"));
Main(require('fs').readFileSync('/dev/stdin', 'utf8'));
