import java.io.*; import java.util.*; import java.math.BigDecimal; import java.math.BigInteger; public class Solution { public static void main(String[] args) { Scanner s = new Scanner(System.in); int a = s.nextInt(), b = s.nextInt(); long t = s.nextLong(); BigInteger result = BigInteger.ONE, TWO = BigInteger.valueOf(2), a_ = BigInteger.valueOf(a), b_ = BigInteger.valueOf(b); //(0.5 * (a + b)) ^ t mod 1000000007 /*for(long i = 0; i < t; i++) { BigInteger A = result.multiply(a_), B = result.multiply(b_); result = A.add(B).divide(TWO); }*/ result = a_.add(b_).divide(TWO).modPow(BigInteger.valueOf(t), BigInteger.valueOf(1000000000 + 7)); System.out.println(result); } }