#include #include #include #include #define var 1000000007 #define inv 500000004 #define ull unsigned long long int ull modular(ull a,ull b) {ull result=1; while(b!=0) { if(b%2!=0) {result=(result*a)%var;} b=b/2; a=(a*a)%var; } return result; } int main() { ull a,b,t,i,sum=0; scanf("%llu%llu%llu",&a,&b,&t); sum=((modular(a+b,t)%var)*(modular(inv,t)%var))%var; printf("%llu",sum); return 0; }