object Solution { import scala.math.BigInt val m = BigInt(1000000007) def main(args: Array[String]): Unit = { val Array(a,b,t) = readLine().split(" ").map(BigInt(_)) assert(((a + b) % 2) == 0) println(((a + b) / 2).modPow(t,m)) } }