POWERUP - Power the Power Up

题意翻译

## 题目描述 给定整数a,b,c,求 $ a^{b^c} mod \;(10^9+7)$ 的值 ($ 0<=a,b,c<=2^{31}-1$) 备注:$ 0^0=1$ ## 输入输出格式 #### 输入格式: 每一行包含3个整数$a,b,c \; (0<=a,b,c<=2^{31}-1)$ 当$a=b=c=-1$ 时,输入样例结束 #### 输出格式: 输出每一组a,b,c对应的解,一行一个 ## 输入输出样例: #### 输入样例#1: ````C++ 2 2 2 3 4 5 -1 -1 -1 ```` #### 输出样例#1: ````C++ 16 763327764 ````

题目描述

Your younger brother's teacher gave him this simple problem. Given _b_ and _c_. Evaluate the result of this expression: _Result_ $ _{1} $ = _b_ $ ^{c} $ Your brother definitely was able to solve this easy problem. So his teacher decided to give him a bit harder problem. Given _a_,_b_ and _c_. Evaluate the result of this expression: _Result_ $ _{1} $ = _b_ $ ^{c} $ $ ^{} $ _Result_ $ _{2} $ = _a_ $ ^{Result1} $ However, your brother was also able to solve it. It was not that harder. His teacher was excited -though- and gave him this Bonus Programming Assignment. Write a program that is given a,b and c; calculates the value of _Result_ $ _{2} $ . Since the output may be exponentially very large, checking the correctness of solutions will be a bit subtle problem. So, instead of printing the whole value of _Result_ $ _{2} $ , just print the reaminder of dividing _Result_ $ _{2} $ by 1,000,000,007 (10 $ ^{9} $ + 7). Can you help him solve that task?

输入输出格式

输入格式


输出格式


输入输出样例

暂无测试点