#include using namespace std; long a,b,i,T,c=(1000000007),K; int power(long T) { if(T==0) { return 1; } else { if(T%2==0) return ((power(T/2)%c)*(power(T/2)%c))%c; else return (((K%c)*(power(T/2)%c)%c)*(power(T/2)%c))%c; } } int main() { cin>>a>>b; cin>>T; long power1; K=(a+b)/2; power1=power(T); cout<