Олимпиадный тренинг

Задача 31881. Raising a to the power of b modulo c


Knowing a, b, c (non-negative integers, do not exceed \(2\cdot10^ 9\) ). Evaluate a to the power of b modulo c  (\(a^b mod \ c\)).

Input
The input is three non-negative integers separated by one space.

Imprint
Display the answer to the problem.

 

Examples
# Input Output
1 2 10 1000 24

Запрещенные операторы:**;pow;log