Euclidean algorithm
A modular multiplicative inverse of modulo can be found by using the extended Euclidean algorithm.