I have to return $a^x b^y(mod p)$
However I'm having difficulty doing this with such large numbers.
I know I can change the format to $a b (mod p)^n$ and I will get a number however I'm just not sure how to work with different exponents, and numbers so large, and still get the correct answer.
$a = 1531201089928563$
$b = 5232015514746838$
$p = 36591670045183523$
$x = 31146826187279844$
$y = 1747419798738$
It is in computer programming. I'm just unsure of how to structure the formula correctly and would like some guidance.