Compute a mod m, modular addition, subtraction, multiplication, exponentiation, and the modular inverse — with clear step-by-step working.
Enter whole numbers. The modulus m must be a positive integer.