object Solution { def main(args: Array[String]) { val sc = new java.util.Scanner(System.in) val a = sc.nextInt() val b = sc.nextInt() val t = BigInt(sc.next()) println(BigInt((0.5*a + 0.5*b).toInt).modPow(t, 1000000007)) } }