Exponentiation - 2#480

Exponentiation - 2

1 second
64 megabytes
Very easy

Given , , and , compute A^B \bmod M.

Input

A single line contains three natural numbers , , and (1 \leq A, B \leq 10^{18}, 2 \leq M \leq 2 \times 10^9) separated by spaces.

Output

Output the value of A^B \bmod M.

Examples

Example 1

Loading
Loading