import java.math.BigInteger; import java.io.*; import java.util.*; 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 input = new Scanner(System.in); long a = input.nextInt(); long b = input.nextInt(); long t = input.nextLong(); input.close(); Long time = new Long(t); BigInteger spread = BigInteger.valueOf(time); BigInteger modulus = new BigInteger("1000000007"); BigInteger values = BigInteger.valueOf((a+b)/2); BigInteger result = values.modPow(spread, modulus); BigInteger fResult = result.mod(modulus); System.out.print(fResult); } }