import java.io.*; import java.util.*; import java.math.BigInteger; public class Solution { public void findTotalViruses(BigInteger k, BigInteger t) { BigInteger mod = new BigInteger("1000000007"); System.out.println(k.modPow(t, mod)); } public static void main(String[] args) { Solution obj = new Solution(); Scanner in = new Scanner(System.in); int a = in.nextInt(); int b = in.nextInt(); int k = (a+b)/2; BigInteger base = new BigInteger(Integer.toString(k)); BigInteger t = new BigInteger(in.next()); obj.findTotalViruses(base,t); } }