Python Extended Euclidean Algorithm Example