import java.io.*; import java.util.*; import java.math.*; public class Solution { public static void main(String[] args) throws Exception{ /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String vals[] = br.readLine().split(" "); BigInteger a = new BigInteger(vals[0]); BigInteger b = new BigInteger(vals[1]); BigInteger t = new BigInteger(vals[2]); a = a.add(b); a = a.divide(new BigInteger("2")); a = a.modPow(t,new BigInteger("1000000007")); System.out.println(a); } }