import java.io.*; import java.util.*; import java.math.*; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); BigInteger a = new BigInteger(sc.next()); BigInteger b = new BigInteger(sc.next()); BigInteger t =new BigInteger(sc.next()); BigInteger mid = a.add(b).divide(new BigInteger("2")); BigInteger result = mid.modPow(t,new BigInteger("1000000007")); //String str = result.mod(new BigInteger("1000000007")); System.out.println(result); /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ } }