Question
Recursive Modular Exponentiation

You are given integers A, B, and M. Compute A^B bmod M using recursive divide-and-conquer exponentiation.

Input

The input contains three integers KaTeX can only parse string typed expression, KaTeX can only parse string typed expression, and KaTeX can only parse string typed expression.

Output

Print KaTeX can only parse string typed expression.

Example
Example:
Input
2 10 1000
Output
24

Online