def modpow(base, exp, mod): if mod == 1: return 0 res = 1 base = base % mod while exp > 0: if exp % 2 == 1: res = (res * base) % mod exp = exp >> 1 base = (base * base) % mod return res s = input() a, b, t = map(int, s.split()) mod = 1000000007 result = modpow(int((a + b)/2), t, mod) print(int(result))