#P130D. Exponentiation

Exponentiation

Description

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

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

Output ab mod 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.

Samples

2
5
40

32

2
5
26

6