import std.stdio, std.string, std.conv;
import std.typecons;
import std.algorithm, std.array, std.range, std.container;
import std.math;

void main() {
	auto data = readln.split, N = data[0].to!int, X = data[1].to!int;
	auto x = readln.split.to!(int[]);
	x = x.map!(a => (a-X).abs).array;
	auto minx = x.reduce!"min(a,b)";
	
	label: foreach_reverse(i; 1 .. minx+1) {
		foreach (y; x) {
			if (y % i != 0) continue label;
		}
		writeln(i); return;
	}
}