(a,b,c)=input().split() (a,b,c)=(int(a),int(b),int(c)) print (pow((a+b)//2,c,1000000007))