void main()
{
    int[] tmp = readln.split.to!(int[]);
    int n = tmp[0], x = tmp[1];
    int[] a = readln.split.to!(int[]);

    a ~= x;
    a.sort!"a < b";
    int[] diff = new int[n];
    foreach (i; 0 .. n)
    {
        diff[i] = a[i+1] - a[i];
    }

    int d = diff[0];
    foreach (i; 1 .. n)
    {
        d = gcd(d, diff[i]);
    }

    d.writeln;
}

import std.stdio;
import std.string;
import std.array;
import std.conv;
import std.algorithm;
import std.range;
import std.math;
import std.numeric;
import std.container;
import std.typecons;
import std.ascii;
import std.uni;