# Enter your code here. Read input from STDIN. Print output to STDOUT def power(x,y,p): res = 1 x = x % p while y > 0: if (y & 1): res = (res * x) % p y = y >> 1 x = (x*x) % p return res a,b,t = map(int,raw_input().strip().split(' ')) num = 0.5 * (a + b) print power(int(num), t, (10**9)+7)