P20094 [HackerRank] Python power mod power
普及-
题目描述

So far, we have only heard of Python's powers. Now, we will witness them!

Powers or exponents in Python can be calculated using the built-in power function. Call the power function $a^{b}$ as shown below:

pow(a,b)

or

a**b

It's also possible to calculate $a^b\mod m$.

pow(a,b,m)

This is very helpful in computations where you have to print the resultant % mod.

Note: Here, $\boldsymbol{a}$ and $\boldsymbol{b}$ can be floats or negatives, but, if a third argument is present, $\boldsymbol{b}$ cannot be negative.

Note: Python has a math module that has its own pow(). It takes two arguments and returns a float. It is uncommon to use math.pow().

Task

You are given three integers: $\boldsymbol{a}$, $\boldsymbol{b}$, and $m$. Print two lines.

On the first line, print the result of pow(a,b). On the second line, print the result of pow(a,b,m).

Input Format

The first line contains $\boldsymbol{a}$, the second line contains $\boldsymbol{b}$, and the third line contains $m$.

Constraints

$1\leq a\leq10$

$1\leq b\leq10$

$2\leq m\leq1000$

Sample Input

3
4
5

Sample Output

81
1

输入格式

见题面

输出格式

见题面

样例输入
3 4 5
样例输出
81 1