a,b,t = input().split() a,b,t = int(a),int(b),int(t) value = pow(int(.5*(a+b)),t,1000000007) print(value)