import java.io.*; import java.util.*; import java.math.*; 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. */ Scanner s=new Scanner(System.in); int a=s.nextInt(); int b=s.nextInt(); long t=s.nextLong(); int in=(a+b)/2; BigInteger int1=new BigInteger(String.valueOf(in)); BigInteger mod=new BigInteger("1000000007"); BigInteger tim=new BigInteger(String.valueOf(t)); BigInteger big1=int1.modPow(tim,mod); System.out.println(big1); } }