public static void main(String[] args) throws Exception { g2(); }
public static void g2() throws Exception { BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out)); BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String str = in.readLine(); String[] split = str.split(" "); int n = Integer.parseInt(split[0]); int s = Integer.parseInt(split[1]);
String str2 = in.readLine(); String[] split2 = str2.split(" "); int[] a = new int[n];
for (int i = 0; i < n; i++) { int x = Integer.parseInt(split2[i]); a[i] = Math.abs(x-s); }
int result = a[0]; for (int i = 1; i < n; i++) { result = gcd(result, a[i]); }