import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static final BigInteger TWO = new BigInteger("2"); public static final BigInteger MOD_VALUE = new BigInteger("1000000007"); public static void main(String[] args) { // TODO Auto-generated method stub Scanner scan = new Scanner(System.in); BigInteger a = scan.nextBigInteger(); BigInteger b = scan.nextBigInteger(); BigInteger t = scan.nextBigInteger(); scan.close(); BigInteger probFx = (a.add(b)).divide(TWO); BigInteger value = power(probFx, t); System.out.println(value.intValue()); } public static BigInteger power(BigInteger x, BigInteger y) { BigInteger temp; if (y == BigInteger.ZERO) return BigInteger.ONE; temp = power(x, y.divide(TWO)); if (y.remainder(TWO) == BigInteger.ZERO) { return (temp.multiply(temp)).mod(MOD_VALUE); } else { if (y.compareTo(BigInteger.ZERO)==1) { return (x.multiply((temp.multiply(temp)))).mod(MOD_VALUE); } else { return ((temp.multiply(temp)).divide(x)).mod(MOD_VALUE); } } } }