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 in = new Scanner(System.in); BigInteger MOD = new BigInteger("1000000007"); long a = in.nextLong(); long b = in.nextLong(); BigInteger t = new BigInteger(in.nextLong()+""); BigInteger r= new BigInteger((long)((a + b) * 0.5)+""); r =r.modPow(t, MOD); System.out.print(r); } }