Explanation and implementation of the extended euclidian algorithm in python