Write a program that, given n, k and m, computes nk modm.
Input
Input consists of several cases,
each one with three natural numbers n, k and m.
Assume 2 ≤ n ≤ 30000 and 2 ≤ m ≤ 30000.
Output
For every case, print nk modm.
About statements
The official statement of a problem is always the one
in the PDF document. The HTML version of the statement
is also given to help you, but may contain some content
that is not well displayed. In case of doubt, always use the PDF.