import fractions
from functools import reduce


def gcd(L):
    return reduce(fractions.gcd, L)


N, X = list(map(int, input().split()))
x = list(map(int, input().split()))
x_gap = [abs(x[i] - X) for i in range(N)]
ans = gcd(x_gap)
print(ans)

dbe065e14bd707c868ed53b759f7cf6d4210f024
<mask token>


def gcd(L):
    return reduce(fractions.gcd, L)


<mask token>

<mask token>


def gcd(L):
    return reduce(fractions.gcd, L)


<mask token>
print(ans)

<mask token>


def gcd(L):
    return reduce(fractions.gcd, L)


N, X = list(map(int, input().split()))
x = list(map(int, input().split()))
x_gap = [abs(x[i] - X) for i in range(N)]
ans = gcd(x_gap)
print(ans)

import fractions
from functools import reduce


def gcd(L):
    return reduce(fractions.gcd, L)


N, X = list(map(int, input().split()))
x = list(map(int, input().split()))
x_gap = [abs(x[i] - X) for i in range(N)]
ans = gcd(x_gap)
print(ans)
