Modular Exponentiation#5198

Modular Exponentiation

1 second
128 megabytes
Very easy

Find the value of the expression x^n~mod~m.

Input

Three positive integers x, n, m~(1 \le x, n \le 10^9, 2 \le m \le 10^9).

Output

Print the value of x^n~mod~m.

Examples

Example 1

Loading
Loading