import math

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

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

dis = []

ans = 0

for i in range(n):

  dis.append(abs(x-xl[i]))

for i in range(n):

  ans = math.gcd(ans,dis[i])

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

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

ans = 0

from math import gcd

for i in range(N):

  ans = gcd(ans,abs(X-x[i]))

print(ans)
import math

n, x = list(map(int, input().split()))
xl = list(map(int, input().split()))
dis = []
ans = 0
for i in range(n):
    dis.append(abs(x - xl[i]))
for i in range(n):
    ans = math.gcd(ans, dis[i])
print(ans)

N, X = list(map(int, input().split()))
x = list(map(int, input().split()))
ans = 0
from math import gcd

for i in range(N):
    ans = gcd(ans, abs(X - x[i]))
print(ans)

-import math +N, X = list(map(int, input().split())) +x = list(map(int, input().split())) +ans = 0 +from math import gcd -n, x = list(map(int, input().split())) -xl = list(map(int, input().split())) -dis = [] -ans = 0 -for i in range(n): -    dis.append(abs(x - xl[i])) -for i in range(n): -    ans = math.gcd(ans, dis[i]) +for i in range(N): +    ans = gcd(ans, abs(X - x[i]))