Competitions

# Week 3: November 23 – 29. For Loop. Part 1

# Modular Exponentiation

Three positive integers **x**, **n** and **m** are given. Find the value of `x`

mod ^{n}**m**.

#### Input

Three positive integers **x**, **n**, **m** (**1** ≤ **x**, **m** ≤ `10`

, ^{9}**2** ≤ **n** ≤ `10`

).^{7}

#### Output

Find and print the value of `x`

mod ^{n}**m**.

Input example #1

2 3 100

Output example #1

8