import std.stdio;
import std.ascii;
import std.conv;
import std.string;
import std.algorithm;
import std.range;
import std.functional;
import std.math;
import core.bitop;
import std.numeric;

alias lread = () => readln.chomp.to!long;
alias aryread = () => readln.split.to!(long[]);

void main()
{
    auto nx = aryread();
    long N = nx[0];
    long X = nx[1];
    auto x = aryread().array;

    x.map!(a => abs(a - X))
        .reduce!((a, b) => gcd(a, b))
        .writeln;
}
