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