Find the last 40 decimal digits of , where
*
*
A computer is too slow to find the entire value of .
Instead, the program must use a fast algorithm for [[wp:Modular exponentiation|modular exponentiation]]: .
The algorithm must work for any integers
where and .