a, b, t = map(int,input().strip().split()) print(int(pow(int(0.5*(a+b)),t, (10**9+7))))