#1981. 取余运算

取余运算

Description

输入b,p,k的值,求b^pmodk的值。其中b,p,k×k为长整型数。

Format

Input

输入b,p,k的值。

Output

求 b^p mod k的值。

Samples

2 10 9
2^10 mod 9=7