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. */ BigInteger bi1, bi2, bi3,bi4,bi5,bi6,bi7,res; Scanner reader = new Scanner(System.in); bi1 = reader.nextBigInteger(); bi2 = reader.nextBigInteger(); bi3 = reader.nextBigInteger(); bi6 = new BigInteger("2"); bi7 = new BigInteger("1000000007"); bi4=bi1.add(bi2); bi5=bi4.divide(bi6); res = bi5.modPow(bi3,bi7); System.out.println(res); } }