Competitions

# PP2. Week 8: April 26 - May 2

# A^B mod C

Given **a**, **b**, **c** find the value of `a`

mod ^{b}**c** (**1** ≤ **a**, **b**, **c** < `2`

).^{63}

#### Input

Contains multiple test cases. Each test is given in one line and contains three integers **a**, **b** and **c**.

#### Output

For each test case print on a separate line the value of `a`

mod ^{b}**c**.

Input example #1

3 2 4 2 10 1000

Output example #1

1 24