#c22902. 快速乘练习

快速乘练习

Fast Multiplication Practice

Problem Description

Given three numbers a,b,Pa, b, P, compute the value of a×ba \times b modulo PP.

Input Format

One line containing three integers a,b,Pa, b, P.

Output Format

Output one integer — the answer.

Sample Input

3 5 10

Sample Output

5

Constraints

For 100%100\% of the test cases, 0≤a,b≤10180 \le a, b \le 10^{18} and 1≤P≤10181 \le P \le 10^{18}.