def gcd(a, b):

    if b == 0:

        return a

    return gcd(b, a % b)





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

p = list(map(int, input().split(' ')))

for i in range(n):

    p[i] = abs(p[i] - x)

ans = p[0]

for i in range(n):

    ans = gcd(p[i], ans)

print(ans)

def gcd(a,b):

    if b==0:

        return a

    else:

        return gcd(b,a%b)

def solve():

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

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

    d = abs(x-l[0])

    for i in range(1,n):

        d = gcd(d,abs(x-l[i]))

    print(d)

if __name__=='__main__':

    solve()
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


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

def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a % b)


def solve():
    n, x = list(map(int, input().split()))
    l = list(map(int, input().split()))
    d = abs(x - l[0])
    for i in range(1, n):
        d = gcd(d, abs(x - l[i]))
    print(d)


if __name__ == "__main__":
    solve()

-    return gcd(b, a % b) +    else: +        return gcd(b, a % b) -n, x = list(map(int, input().split(" "))) -p = list(map(int, input().split(" "))) -for i in range(n): -    p[i] = abs(p[i] - x) -ans = p[0] -for i in range(n): -    ans = gcd(p[i], ans) -print(ans) +def solve(): +    n, x = list(map(int, input().split())) +    l = list(map(int, input().split())) +    d = abs(x - l[0]) +    for i in range(1, n): +        d = gcd(d, abs(x - l[i])) +    print(d) + + +if __name__ == "__main__": +    solve()