text: Python3 program to implement the above approach To run this code , we need to copy modular inverse from below post . https : www . geeksforgeeks . org / multiplicative - inverse - under - modulo - m /
code: if __name__ == ' _ _ main _ _ ' : NEW_LINE