import java.io.*; import java.util.*; import java.math.*; public class Solution { /* long pow (long a, int b) { if ( b == 0) return 1; if ( b == 1) return a; if ( b & 1 == 0) return pow ( a * a, b/2); //even a=(a^2)^b/2 else return a * pow ( a * a, b/2); //odd a=a*(a^2)^b/2 }*/ 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 sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); BigInteger t = sc.nextBigInteger(); BigInteger tmp = new BigDecimal((0.5*(a+b))).toBigInteger(); BigInteger m = new BigInteger("1000000007"); BigInteger result = tmp.modPow(t,m); // int result = (int)Math.pow((0.5*(a+b)),t); //result = result % 1000000007; System.out.println(result); } }