import java.io.*; import java.util.*; import java.math.BigInteger; 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. */ Scanner scan = new Scanner(System.in); int a = scan.nextInt(); int b = scan.nextInt(); String modulo = "1000000007"; String millis = scan.next(); BigInteger size = new BigInteger(Integer.toString((a + b) /2)); size = size.modPow(new BigInteger(millis), new BigInteger(modulo)); System.out.println(size); } }