import java.io.*; import java.util.*; import java.math.*; public class Solution { public static void main(String[] args) { Scanner in = new Scanner(System.in); BigInteger a = new BigInteger(in.next()); BigInteger b = new BigInteger(in.next()); BigInteger t = new BigInteger(in.next()); BigInteger d = new BigInteger("2"); BigInteger mod = new BigInteger("1000000007"); BigInteger growth = (a.add(b).divide(d)).modPow(t,mod); //% (1000000007); System.out.println(growth); } }