// By J.D. Sandifer - 2016-07-27 // Trying built-in BigInteger and modPow function. // Why reinvent the wheel? import java.io.*; import java.util.*; import java.math.*; public class Solution { public static void main(String[] args) { Scanner in = new Scanner(System.in); int a = in.nextInt(); int b = in.nextInt(); long endTime = in.nextLong(); in.close(); BigInteger growthRate = BigInteger.valueOf((a + b) / 2); BigInteger bigTime = BigInteger.valueOf(endTime); BigInteger modulator = BigInteger.valueOf((long) Math.pow(10, 9) + 7); BigInteger cells = growthRate.modPow(bigTime, modulator); System.out.println(cells.intValue()); } }