POWERUP  Power the Power Up
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?
Input
The input consists of several test cases. Each case is on a single line. In each case, given three space separated integers a,b and c (0 <=a, b, c <= 2^{31}  1). The input is terminated by a = b = c =  1
Output
For each case, print exactly one line containing the value of Result_{2} modulus 10^{9} + 7
Input
2 2 2
3 4 5
1 1 1
Output
16
763327764
Note
You can assume that 0^{0} = 1.
hide comments
Abhishek:
20141227 13:25:31
Please provide test case for which my code fails ,13280275


knb_dtu:
20141216 12:04:30
Can u please give testcase for which my code fails?(id=>13180863) 

Pawankumar P:
20141213 08:50:09
While scanning  int => ac long long => wa. No idea why! 

Jignesh:
20141201 14:00:22
nice problem, nice tricky cases 

ivar.raknahs:
20141124 04:35:43
can't find the tricky cases ,need help? 

Sankaranarayanan G:
20141119 17:47:53
I don't know where I am going wrong. Can you suggest anything? 

bourne:
20141118 08:24:06
According to me, the following boundary test cases and their answers 


CHANDAN KUMAR:
20141115 23:03:16
Can anyone please tell me what is the tricky cases


ivar.raknahs:
20141109 10:45:47
@Ahmed Salem [mrtempo]=>id(12852095)

Added by:  Ahmed Salem [mrtempo] 
Date:  20141106 
Time limit:  1s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ASM64 
Resource:  Palestinian Collegiate Programming Contest 2013 