MOD = (10**9 + 7) def power(x, y): if y == 0: return 1 tmp = power(x, y//2) % MOD if y % 2 == 0: return tmp*tmp else: return (x % MOD)*tmp*tmp s = input().split() a, b, t = int(s[0]), int(s[1]), int(s[2]) p = power((a+b)//2, t) print((p) % MOD)