#include #include #include #include long long power(int b,long long n) { if(n==0) return 1; if(n%2==0) return (power(b,n/2)%1000000007*((power(b,n/2)%1000000007)%1000000007)); else return (power(b,n-1)%1000000007*((b%1000000007)%1000000007)); } int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ int a,b,k; long long t; scanf("%d%d%lld",&a,&b,&t); k=0.5*(a+b); printf("%lld",power(k,t)%1000000007); return 0; }