# Enter your code here. Read input from STDIN. Print output to STDOUT a = map(int,raw_input().strip().split(" ")) print int(pow((a[0]+a[1])/2,a[2],10 ** 9 + 7))