Modular exponentiation


would you please tell me why all test cases are not passing.At what point i am getting stuck.