import java.io.*; import java.util.*; import java.math.*; public class Solution { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int a=sc.nextInt(); int b=sc.nextInt(); BigInteger total=new BigInteger("1"); BigInteger modulo=new BigInteger("1000000007"); BigInteger time=sc.nextBigInteger(); double sum=0; int tot=0; BigInteger numberOfCells; sum=0.5 *(a+b); tot=(int)sum; total=BigInteger.valueOf(tot); numberOfCells=total.modPow(time,modulo); System.out.println(numberOfCells); /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ } }