Algorithm for computing modular inverse in MPC Is there any known algorithm for calculating $a^{-1} \pmod{q}$, where $ q &lt; p$ and $F_{p}$ is the prime field of the MPC, in a linear secret sharing scheme ?

I have tried using the standard algorithm, in which the parties generate $r$, then run secure multiplication on shared values to get $r⋅a$ and open it, and then each local invert the result. Finally, each uses local scalar multiplication of their share of $r$ to get shares of $a^{-1} \pmod{q}$.
However this doesn't work when the field of inverse is different from the MPC field.
In general: $a^{-1} \equiv a^{\phi (q)-1} \pmod q$ where $\phi$ is euler totient function. If $q$ is a prime, then $\phi (q)=q-1$ and thus $a^{-1} \equiv a^{q-2} \pmod q$.