#coding: utf-8

from functools import reduce

def gcd(a, b):

    if b == 0:

        return max(a, b)

    else:

        return gcd(b, a%b)



N, X = list(map(int, input().split()))

x = list(map(int, input().split()))

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

print((reduce(gcd, x)))
#coding: utf-8

from functools import reduce

from fractions import gcd    #py<=3.4

#from math import gcd    # py >= 3.5

N, X = list(map(int, input().split()))

x = list(map(int, input().split()))

res = [abs(x[i] - X) for i in range(N)]

print((reduce(gcd, res)))
# coding: utf-8
from functools import reduce


def gcd(a, b):
    if b == 0:
        return max(a, b)
    else:
        return gcd(b, a % b)


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

# coding: utf-8
from functools import reduce
from fractions import gcd  # py<=3.4

# from math import gcd    # py >= 3.5
N, X = list(map(int, input().split()))
x = list(map(int, input().split()))
res = [abs(x[i] - X) for i in range(N)]
print((reduce(gcd, res)))

+from fractions import gcd  # py<=3.4 - -def gcd(a, b): -    if b == 0: -        return max(a, b) -    else: -        return gcd(b, a % b) - - +# from math import gcd    # py >= 3.5 -x = [abs(X - x[i]) for i in range(N)] -print((reduce(gcd, x))) +res = [abs(x[i] - X) for i in range(N)] +print((reduce(gcd, res)))