Euclidean algorithm
be computed via extended Euclidean algorithm