def gcd_fast(a: int, b: int) -> tuple:
	"""
	GCD using Euler's Extended Algorithm generalized for all integers of the
	set Z. Including negative values.

	:param a: The first number.
	:param b: The second number.
	:return: gcd,x,y. Where x and y are bezout's coeffecients.
	"""

	gcd=0
	x=0
	y=0
	x=0
	"""
	if a < 0:
		sign_x=-1
	else:
		sign_x=1
	if b < 0:
		sign_y=-1
	else:
		sign_y=1
	"""
	#if a or b is zero return the other value and the coeffecient's accordingly.
	if a==0:
		return b, 0, 1
	elif b==0:
		return a, 0, 1
	#otherwise actually perform the calculation.
	else:
		#set the gcd x and y according to the outputs of the function.
		# a is b (mod) a. b is just a.
		gcd, x, y = gcd_fast(b % a, a)
		#we're returning the gcd, x equals y - floor(b/a) * x
		# y is thus x.
		return gcd, y - (b // a) * x, x