import java.io.*; import java.util.*; public class Solution { public static void main(String[] args) { /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ try(Scanner in = new Scanner(System.in)) { int a = in.nextInt(); int b = in.nextInt(); int t = in.nextInt(); double expected = (a + b) / 2.0; expected = Math.pow(expected, t); while(expected > 10000007) { expected -= 10000007; } System.out.println((int)expected); } } }