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

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

 

bb = [abs(a-m) for a in aa]



def gcd(a,b):

    while b:

        a, b = b, a % b

    return a

    

if len(aa) == 1:

    print((abs(aa[0]-m)))

else:

    while len(bb) > 1:

        a, b = bb.pop(), bb.pop()

        bb.append(gcd(a,b))

    print((bb[0]))
n,m = list(map(int,input().split()))

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

 

bb = [abs(a-m) for a in aa]





def gcd(a,b):

    while b:

        a, b = b, a % b

    return a



    

ans = bb[0]

if len(aa) == 1:

    print((abs(aa[0]-m)))

else:

    for b in bb:

        ans = gcd(ans,b)

    print(ans)
n, m = list(map(int, input().split()))
aa = list(map(int, input().split()))
bb = [abs(a - m) for a in aa]


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


if len(aa) == 1:
    print((abs(aa[0] - m)))
else:
    while len(bb) > 1:
        a, b = bb.pop(), bb.pop()
        bb.append(gcd(a, b))
    print((bb[0]))

n, m = list(map(int, input().split()))
aa = list(map(int, input().split()))
bb = [abs(a - m) for a in aa]


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


ans = bb[0]
if len(aa) == 1:
    print((abs(aa[0] - m)))
else:
    for b in bb:
        ans = gcd(ans, b)
    print(ans)

+ans = bb[0] -    while len(bb) > 1: -        a, b = bb.pop(), bb.pop() -        bb.append(gcd(a, b)) -    print((bb[0])) +    for b in bb: +        ans = gcd(ans, b) +    print(ans)