import java.io.*; import java.util.*; import java.math.BigInteger; public class Solution { public static void main (String args[]) { Scanner scanner = new Scanner(System.in); int factorA = scanner.nextInt(); int factorB = scanner.nextInt(); BigInteger time = new BigInteger(scanner.next()); BigInteger mod = new BigInteger("1000000007"); int temp = (factorA + factorB)/2; BigInteger divider = new BigInteger(Integer.toString(temp)); System.out.println(divider.modPow(time, mod)); scanner.close(); } }