300683: CF130D. Exponentiation

Memory Limit:64 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

D. Exponentiationtime limit per test2 secondsmemory limit per test64 megabytesinputstandard inputoutputstandard output

You are given integers a, b and c. Calculate ab modulo c.

Input

Input data contains numbers a, b and c, one number per line. Each number is an integer between 1 and 100, inclusive.

Output

Output ab mod c.

ExamplesInput
2
5
40
Output
32
Input
2
5
26
Output
6

Input

加入题单

算法标签: