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:

    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()))))
from fractions import gcd

res = xlis[0]
for i in xlis:
    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)

+    if i % res == 0: +        continue