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) { Scanner in=new Scanner(System.in); int a=in.nextInt(); int b=in.nextInt(); BigInteger t=new BigInteger(in.next()); BigInteger base=new BigInteger(String.valueOf((a+b)/2)); BigInteger mod=new BigInteger(String.valueOf(1000000000+7)); base=base.modPow(t,mod); System.out.print(base.toString()); /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ } }