import fractions

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

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

ans = x[1]-x[0]

for i in range(1,n):

    ans = fractions.gcd(ans,x[i+1]-x[i])

print(ans)
n,c = list(map(int,input().split()))

x = [c] + list(map(int,input().split()))

x.sort()

ans = x[1]-x[0]

import math

for i in range(1,n):

    ans = math.gcd(ans,x[i+1]-x[i])

print(ans)
import fractions

n, X = list(map(int, input().split()))
x = sorted(list(map(int, input().split())) + [X])
ans = x[1] - x[0]
for i in range(1, n):
    ans = fractions.gcd(ans, x[i + 1] - x[i])
print(ans)

n, c = list(map(int, input().split()))
x = [c] + list(map(int, input().split()))
x.sort()
ans = x[1] - x[0]
import math

for i in range(1, n):
    ans = math.gcd(ans, x[i + 1] - x[i])
print(ans)

-import fractions +n, c = list(map(int, input().split())) +x = [c] + list(map(int, input().split())) +x.sort() +ans = x[1] - x[0] +import math -n, X = list(map(int, input().split())) -x = sorted(list(map(int, input().split())) + [X]) -ans = x[1] - x[0] -    ans = fractions.gcd(ans, x[i + 1] - x[i]) +    ans = math.gcd(ans, x[i + 1] - x[i])