a,b,t = [int(temp) for temp in input().strip().split(' ')] res = pow(int(((a+b)/2)),t,10**9+7) print(int(res))