# Enter your code here. Read input from STDIN. Print output to STDOUT def p(x, y, d): if y == 0: return 1 temp = p(x, y/2, d) % d if y%2 == 0: return temp*temp else: if y > 0: return x*temp*temp else: return (temp*temp)/x a = map(int,raw_input().strip().split(' ')) x=(a[0]+a[1])/2 y=a[2] d=10**9+7 print p(x,y,d)%d