def g_c_d(x, y):

    if x == 0:

        return y

    elif y == 0:

        return x

    else:

        return g_c_d(y, x%y)





a, b = list(map(int, input().split()))

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

c.append(b)

c.sort()

d = 0

for i in range(1, a + 1):

    d = g_c_d(c[i] - c[i-1], d)

print(d)

def g_c_d(x, y):

    if x == 0:

        return y

    elif y == 0:

        return x

    else:

        return g_c_d(y, x % y)





a, b = list(map(int, input().split()))

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

c.append(b)

d = 0

for i in range(len(c)):

    d = g_c_d(d, abs((c[i] - c[i-1])))

print(d)

def g_c_d(x, y):
    if x == 0:
        return y
    elif y == 0:
        return x
    else:
        return g_c_d(y, x % y)


a, b = list(map(int, input().split()))
c = list(map(int, input().split()))
c.append(b)
c.sort()
d = 0
for i in range(1, a + 1):
    d = g_c_d(c[i] - c[i - 1], d)
print(d)

def g_c_d(x, y):
    if x == 0:
        return y
    elif y == 0:
        return x
    else:
        return g_c_d(y, x % y)


a, b = list(map(int, input().split()))
c = list(map(int, input().split()))
c.append(b)
d = 0
for i in range(len(c)):
    d = g_c_d(d, abs((c[i] - c[i - 1])))
print(d)

-c.sort() -for i in range(1, a + 1): -    d = g_c_d(c[i] - c[i - 1], d) +for i in range(len(c)): +    d = g_c_d(d, abs((c[i] - c[i - 1])))