import java.io.*; import java.util.*; import java.math.*; 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 sc = new Scanner(System.in); BigInteger a = new BigInteger(sc.next()); BigInteger b = new BigInteger(sc.next()); BigInteger t = new BigInteger(sc.next()); Integer m = new Integer(1000000007); BigInteger modder = new BigInteger(m.toString()); BigInteger sum = BigInteger.ZERO; sum = sum.add(a); sum = sum.add(b); BigDecimal rational = new BigDecimal(sum); rational = rational.divide(new BigDecimal(2)); BigInteger output = rational.toBigIntegerExact(); output = output.modPow(t, modder); System.out.println(output.toString()); sc.close(); } }