import std.stdio;
import std.algorithm;
import std.conv;
import std.math;
import std.string;

void main()
{
	auto tokens1 = split(chomp(readln()));
	auto tokens2 = split(chomp(readln()));
	auto n = to!int(tokens1[0]);
	auto x = to!int(tokens1[1]);
	int[] xs;
	xs ~= x;
	foreach (token; tokens2)
	{
		xs ~= to!int(token) - xs[$-1];
	}
	xs.sort;

	foreach (i, ref e; xs[1..$])
	{
		e = e - xs[i-1];
	}

	int gcd(int a, int b)
	{
		if (b == 0) return a;
		return gcd(b, a % b);
	}

	int d = gcd(xs[1], xs[0]);
	foreach (i; 2..xs.length)
	{
		d = gcd(xs[i], d);
	}

	writeln(d);
	stdout.flush();
}