import fractions



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

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



gcd_value = abs(X-x[0])



for i in range(1,n):

    gcd_value = fractions.gcd(gcd_value,abs(X-x[i]))



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

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



def gcd(a,b):

  while b!=0:

    a,b=b,a%b

  return a



gcd_value = abs(X-x[0])



for i in range(1,n):

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



print(gcd_value)
import fractions

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

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


def gcd(a, b):
    while b != 0:
        a, b = b, a % b
    return a


gcd_value = abs(X - x[0])
for i in range(1, n):
    gcd_value = gcd(gcd_value, abs(X - x[i]))
print(gcd_value)

-import fractions - + + +def gcd(a, b): +    while b != 0: +        a, b = b, a % b +    return a + + -    gcd_value = fractions.gcd(gcd_value, abs(X - x[i])) +    gcd_value = gcd(gcd_value, abs(X - x[i]))