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 scanner = new Scanner(System.in); BigInteger a =scanner.nextBigInteger(); BigInteger b =scanner.nextBigInteger(); BigInteger t =scanner.nextBigInteger(); BigInteger div = new BigInteger("2"); BigInteger mod = new BigInteger("1000000007"); BigInteger tv = (a.add(b).divide(div)).modPow(t,mod); System.out.println(tv); } }