import sys

from fractions import gcd



input = sys.stdin.readline





def main():

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

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



    x.append(X)

    x.sort()

    ans = x[1] - x[0]

    for i in range(1, N):

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



    print(ans)





if __name__ == "__main__":

    main()

import sys

from fractions import gcd



input = sys.stdin.readline





def main():

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

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



    y = [abs(i - X) for i in x]

    ans = y[0]

    for i in range(1, N):

        ans = gcd(ans, y[i])



    print(ans)





if __name__ == "__main__":

    main()

import sys
from fractions import gcd

input = sys.stdin.readline


def main():
    N, X = list(map(int, input().split()))
    x = list(map(int, input().split()))
    x.append(X)
    x.sort()
    ans = x[1] - x[0]
    for i in range(1, N):
        ans = gcd(ans, x[i + 1] - x[i])
    print(ans)


if __name__ == "__main__":
    main()

import sys
from fractions import gcd

input = sys.stdin.readline


def main():
    N, X = list(map(int, input().split()))
    x = list(map(int, input().split()))
    y = [abs(i - X) for i in x]
    ans = y[0]
    for i in range(1, N):
        ans = gcd(ans, y[i])
    print(ans)


if __name__ == "__main__":
    main()

-    x.append(X) -    x.sort() -    ans = x[1] - x[0] +    y = [abs(i - X) for i in x] +    ans = y[0] -        ans = gcd(ans, x[i + 1] - x[i]) +        ans = gcd(ans, y[i])