Buggy python submission (verdict: Runtime Error):
n,x = map(int, input().split())
city = []
sub = []
city = list(map(int, input().split()))

for i in range(len(city)):
	sub.append(abs(x - city[i]))


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


if sub == 1:
	print(sub[0])
elif sub == 2:
	print(gcd(sub[0],sub[1]))
else:
	p = gcd(sub[0], sub[1])
	for i in range(2,len(sub)):
		p = gcd(p,sub[i])
	print(p)

Fixed submission:
n,x = map(int, input().split())
city = []
sub = []
city = list(map(int, input().split()))

for i in range(len(city)):
	sub.append(abs(x - city[i]))

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


if len(sub) == 1:
	print(sub[0])
elif len(sub) == 2:
	print(gcd(sub[0],sub[1]))
else:
	p = gcd(sub[0], sub[1])
	for i in range(2,len(sub)):
		p = gcd(p,sub[i])
	print(p)

Buggy python submission (verdict: Runtime Error):
n,x = map(int, input().split())
city = []
sub = []
city = list(map(int, input().split()))

for i in range(len(city)):
	sub.append(abs(x - city[i]))

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

p = gcd(sub[0], sub[1])
if sub == 1:
	print(sub[0])
elif sub == 2:
	print(gcd(sub[0],sub[1]))
else:
	for i in range(2,len(sub)):
		ans = gcd(p,sub[i])
		p = ans
	print(p)

Fixed submission:
n,x = map(int, input().split())
city = []
sub = []
city = list(map(int, input().split()))

for i in range(len(city)):
	sub.append(abs(x - city[i]))

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


if len(sub) == 1:
	print(sub[0])
elif len(sub) == 2:
	print(gcd(sub[0],sub[1]))
else:
	p = gcd(sub[0], sub[1])
	for i in range(2,len(sub)):
		p = gcd(p,sub[i])
	print(p)

Buggy python submission (verdict: Runtime Error):
n,x = map(int, input().split())
city = []
sub = []
city = list(map(int, input().split()))

for i in range(len(city)):
	sub.append(abs(x - city[i]))

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

p = gcd(sub[0], sub[1])
for i in range(2,len(sub)):
	ans = gcd(p,sub[i])
	p = ans

print(p)

Fixed submission:
n,x = map(int, input().split())
city = []
sub = []
city = list(map(int, input().split()))

for i in range(len(city)):
	sub.append(abs(x - city[i]))

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


if len(sub) == 1:
	print(sub[0])
elif len(sub) == 2:
	print(gcd(sub[0],sub[1]))
else:
	p = gcd(sub[0], sub[1])
	for i in range(2,len(sub)):
		p = gcd(p,sub[i])
	print(p)

Buggy python submission (verdict: Runtime Error):
n,x = map(int, input().split())
city = []
sub = []
city = list(map(int, input().split()))

for i in range(len(city)):
	sub.append(abs(x - city[i]))

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

p = gcd(sub[0], sub[1])
for i in range(2,len(sub)):
	ans = gcd(p,sub[i])

print(ans)

Fixed submission:
n,x = map(int, input().split())
city = []
sub = []
city = list(map(int, input().split()))

for i in range(len(city)):
	sub.append(abs(x - city[i]))

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


if len(sub) == 1:
	print(sub[0])
elif len(sub) == 2:
	print(gcd(sub[0],sub[1]))
else:
	p = gcd(sub[0], sub[1])
	for i in range(2,len(sub)):
		p = gcd(p,sub[i])
	print(p)

Buggy python submission (verdict: Runtime Error):
n,x = map(int, input().split())
city = []
sub = []
city = list(map(int, input().split()))

for i in range(len(city)):
	sub.append(abs(x - city[i]))

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

for i in range(1,len(sub)):
	ans = gcd(sub[i-1], sub[i])

print(ans)

Fixed submission:
n,x = map(int, input().split())
city = []
sub = []
city = list(map(int, input().split()))

for i in range(len(city)):
	sub.append(abs(x - city[i]))

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


if len(sub) == 1:
	print(sub[0])
elif len(sub) == 2:
	print(gcd(sub[0],sub[1]))
else:
	p = gcd(sub[0], sub[1])
	for i in range(2,len(sub)):
		p = gcd(p,sub[i])
	print(p)