{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003e\r\n\tGiven three integers, you will have to find the value of X where X\u003d (B\u003csup\u003eP\u003c/sup\u003e)\u0026nbsp;mod M. Here mod is the modulo (%) operation which gives the value of the remainder.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003e\r\n\tPer line you will be given three numbers B,P and M (0\u0026lt;\u003dB,P\u0026lt;2\u003csup\u003e31\u003c/sup\u003e\u0026nbsp;and 1\u0026lt;\u003dM\u0026lt;\u003d46340). Input will be taken \u003cspan data-scayt_word\u003d\"upto\" data-scaytid\u003d\"1\"\u003eupto\u003c/span\u003e End of File.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003e\r\n\tOutput a single line giving the result.\u003c/p\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre\u003e\r\n\u003cspan style\u003d\"font-size:14px;\"\u003e\r\n\r\n17\r\n1765\r\n3\r\n\r\n3\r\n18132\r\n17\r\n\r\n2374859\r\n3029382\r\n36123\u003c/span\u003e\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cp\u003e\r\n\t\u0026nbsp;\u003c/p\u003e\r\n\u003cpre\u003e\r\n\u003cspan style\u003d\"font-size:14px;\"\u003e2\r\n13\r\n13195\u003c/span\u003e\u003c/pre\u003e"}},{"title":"Hint","value":{"format":"HTML","content":"\u003cp\u003e\r\n\tFor example (2\u003csup\u003e3\u003c/sup\u003e) mod 5 \u003d 3. Because after dividing 5 from 8, we shall get the remainder 3.\u003c/p\u003e"}}]}