Modular inverse python