function Main(input){
    const arr = input.split('\n');
    const X = Number(arr[0].split(' ')[1]);
    const xi = arr[1].split(' ').map(Number);
    const xi_cal = xi.map(val => Math.abs(val-X));
    const GCD = (n, m) => {
        if(n % m === 0) return m;
        return GCD(m, n % m);
    }
    console.log(xi_cal.reduce((a,b) =>GCD(a,b)));
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
