import java.io.*; import java.util.*; import java.math.BigInteger; public class Solution { public static void main(String[] args) { /* Enter your code here. Read input from STDIN. Print outut to STDOUT. Your class should be named Solution. */ Scanner in = new Scanner(System.in); /* Parse input */ int a = in.nextInt(); int b = in.nextInt(); BigInteger t = in.nextBigInteger(); /* Close scanner */ in.close(); /* Calculate and print number of expected virus cells */ BigInteger mod = BigInteger.valueOf((long)(Math.pow(10,9)+7)); int numOfCells = (BigInteger.valueOf((long)(0.5*a+0.5*b))).modPow(t, mod).intValue(); System.out.println(numOfCells); } }