import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; 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 in = new Scanner(System.in); int a = in.nextInt(); int b = in.nextInt(); long t = in.nextLong(); int base = (a + b)/2; long mod = 1000000007; BigInteger bigBase = BigInteger.valueOf(base); BigInteger time = BigInteger.valueOf(t); BigInteger modulus = BigInteger.valueOf(mod); System.out.println(modPow(bigBase, time, modulus)); } public static BigInteger modPow(BigInteger base, BigInteger e, BigInteger m) { BigInteger result = BigInteger.ONE; base = base.mod(m); for (int idx = 0; idx < e.bitLength(); ++idx) { if (e.testBit(idx)) { result = result.multiply(base).mod(m); } base = base.multiply(base).mod(m); } return result; } }