object Solution { def main(args: Array[String]) { /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution */ val sc = new java.util.Scanner (System.in); val a = sc.nextInt() val b = sc.nextInt() val t = sc.next val noOfCells = BigInt((a + b) / 2).modPow(BigInt(t), (BigInt(10).pow(9) + 7)) println(noOfCells) } }