Fix overflow bug in modular exponentiation.
Solve problem 123 using C++.