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 sc = new Scanner(System.in); BigInteger a = sc.nextBigInteger(); BigInteger b = sc.nextBigInteger(); BigInteger t = sc.nextBigInteger(); BigInteger e = new BigInteger("1000000007"); BigInteger ans,x; a=a.add(b); x=a.divide(new BigInteger("2")); System.out.println(x.modPow(t,e)); /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ } }