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) { Scanner scan = new Scanner(System.in); BigInteger mod = new BigInteger("1000000007"); int a = scan.nextInt(); int b = scan.nextInt(); String t_str = scan.next(); // Big BigInteger t = new BigInteger(t_str); BigInteger exp = BigInteger.valueOf(a + b).divide(BigInteger.valueOf(2)).modPow(t,mod); System.out.println(exp); } }