import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; 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 in = new Scanner(System.in); BigInteger a = new BigInteger(in.next()); BigInteger b = new BigInteger(in.next()); BigInteger t = new BigInteger(in.next()); BigInteger mod = new BigInteger("10").pow(new Integer("9")).add(new BigInteger("7")); BigInteger big = new BigDecimal(a.add(b)).multiply(BigDecimal.valueOf(0.5)).toBigInteger().modPow(t,mod); BigDecimal bd = new BigDecimal(a.add(b)); System.out.println(big); } }