https://numbas.mathcentre.ac.uk/question/23633/modular-arithmetic-extended-euclidean-algorithm/embed/