favorite We need a little bit of your help to keep things running, click on this banner to learn more
Competitions

# Modular Exponentiation

Three positive integers x, n and m are given. Find the value of xn mod m.

#### Input

Three positive integers x, n, m (1x, m109, 2n107).

#### Output

Find and print the value of xn mod m.

Time limit 1 second
Memory limit 128 MiB
Input example #1
2 3 100

Output example #1
8