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 sc=new Scanner(System.in); BigInteger a = sc.nextBigInteger(); BigInteger b = sc.nextBigInteger(); BigInteger t = sc.nextBigInteger(); BigInteger d = new BigInteger("2"); BigInteger m = new BigInteger("1000000007"); BigInteger res = ((a.add(b)).divide(d)).modPow(t, m); //long res2 = ; //res2/=2*t; System.out.println(res); } }