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

l = sorted(map(int, input().split()+[X]))

r = [l[n+1] - l[n] for n in range(N)]

ans = r.pop()

for i in r:

    while ans%i != 0:

        ans,i = i,ans%i

    ans = i

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

r = [abs(X-i) for i in map(int, input().split())]

ans = r.pop()

for i in r:

    while ans%i != 0:

        ans,i = i,ans%i

    ans = i

print(ans)
N, X = list(map(int, input().split()))
l = sorted(map(int, input().split() + [X]))
r = [l[n + 1] - l[n] for n in range(N)]
ans = r.pop()
for i in r:
    while ans % i != 0:
        ans, i = i, ans % i
    ans = i
print(ans)

N, X = list(map(int, input().split()))
r = [abs(X - i) for i in map(int, input().split())]
ans = r.pop()
for i in r:
    while ans % i != 0:
        ans, i = i, ans % i
    ans = i
print(ans)

-l = sorted(map(int, input().split() + [X])) -r = [l[n + 1] - l[n] for n in range(N)] +r = [abs(X - i) for i in map(int, input().split())]