a,b,t = map(int, input().strip().split(" ")) def power(x, y) : if (y == 0): return 1 temp = power(x, y//2) if(y%2 ==0): return temp * temp else : return x * temp * temp print(int(power(0.5 * (a+b), t) % 1000000007))