import sys

import fractions



sys.setrecursionlimit(10**9)

def input(): return sys.stdin.readline().strip()

def INT(): return int(eval(input()))

def LIST(): return [int(x) for x in input().split()]

MOD = 10**9 + 7



N, X = LIST()



x = LIST()



dx = [abs(i - X) for i in x]



def gcd_all(n):

    if len(n) == 1:

        return n[0]



    tail = n.pop(-1)

    return fractions.gcd(tail, gcd_all(n))



print((gcd_all(dx)))

import sys

import fractions



sys.setrecursionlimit(10**9)

def input(): return sys.stdin.readline().strip()

def INT(): return int(eval(input()))

def LIST(): return [int(x) for x in input().split()]

MOD = 10**9 + 7



N, X = LIST()



x = LIST()



dx = [abs(i - X) for i in x]



ans = dx[0]

for i in range(1, N):

    ans = fractions.gcd(ans, dx[i])



print(ans)

import sys
import fractions

sys.setrecursionlimit(10**9)


def input():
    return sys.stdin.readline().strip()


def INT():
    return int(eval(input()))


def LIST():
    return [int(x) for x in input().split()]


MOD = 10**9 + 7
N, X = LIST()
x = LIST()
dx = [abs(i - X) for i in x]


def gcd_all(n):
    if len(n) == 1:
        return n[0]
    tail = n.pop(-1)
    return fractions.gcd(tail, gcd_all(n))


print((gcd_all(dx)))

import sys
import fractions

sys.setrecursionlimit(10**9)


def input():
    return sys.stdin.readline().strip()


def INT():
    return int(eval(input()))


def LIST():
    return [int(x) for x in input().split()]


MOD = 10**9 + 7
N, X = LIST()
x = LIST()
dx = [abs(i - X) for i in x]
ans = dx[0]
for i in range(1, N):
    ans = fractions.gcd(ans, dx[i])
print(ans)

- - -def gcd_all(n): -    if len(n) == 1: -        return n[0] -    tail = n.pop(-1) -    return fractions.gcd(tail, gcd_all(n)) - - -print((gcd_all(dx))) +ans = dx[0] +for i in range(1, N): +    ans = fractions.gcd(ans, dx[i]) +print(ans)