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

def myabs(i):

    return abs(i-X)

xlis = list(map(myabs, list(map(int, input().split()))))



from fractions import gcd



res = xlis[0]

for i in xlis:

    if i%res == 0:

        continue

    res = gcd(i,res)



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

def myabs(i):

    return abs(i-X)

xlis = list(map(myabs, list(map(int, input().split()))))





def gcd(a, b):

    while b != 0:

        a, b = b, a%b

    return a



res = xlis[0]

for i in xlis:

    if i%res == 0:

        continue

    res = gcd(i,res)



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


def myabs(i):
    return abs(i - X)


xlis = list(map(myabs, list(map(int, input().split()))))
from fractions import gcd

res = xlis[0]
for i in xlis:
    if i % res == 0:
        continue
    res = gcd(i, res)
print(res)

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


def myabs(i):
    return abs(i - X)


xlis = list(map(myabs, list(map(int, input().split()))))


def gcd(a, b):
    while b != 0:
        a, b = b, a % b
    return a


res = xlis[0]
for i in xlis:
    if i % res == 0:
        continue
    res = gcd(i, res)
print(res)

-from fractions import gcd + + +def gcd(a, b): +    while b != 0: +        a, b = b, a % b +    return a +