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

void main() {
    auto tmp = readln.split.to!(long[]);
    auto N = tmp[0], X = tmp[1];
    auto xs = readln.split.to!(long[]);
    xs.map!(x => abs(x - X)).reduce!((a,b) => gcd(a,b)).writeln;
}

