import java.math.BigInteger; import java.util.Scanner; /** * Created by abzal on 7/27/16. */ public class Solution { public static void main(String[] args) { Scanner in = new Scanner(System.in); int a = in.nextInt(); int b = in.nextInt(); String time = in.next(); BigInteger bigTime = new BigInteger(time); int c = (a + b) / 2; System.out.println(BigInteger.valueOf(c).modPow(bigTime, BigInteger.valueOf(1000000000 + 7))); //System.out.println(pow(BigInteger.valueOf(c), bigTime)); } static BigInteger pow(BigInteger a, BigInteger exp) { if (exp.equals(BigInteger.ZERO)) { return BigInteger.ONE; } BigInteger temp = pow(a, exp.divide(BigInteger.valueOf(2))).mod(BigInteger.valueOf(1000000000 + 7)); if (exp.mod(BigInteger.valueOf(2)).equals(BigInteger.ZERO)) { return (temp.multiply(temp)); } else { return (a.multiply(temp).multiply(temp)); } } }