import java.io.*; import java.util.*; import java.math.BigInteger; public class Solution { static long mod = 1000000007; public static void main(String[] args) { Scanner in = new Scanner(System.in); long virus; int aGrow = in.nextInt(); int bGrow = in.nextInt(); long t = in.nextLong(); virus = pow((aGrow+bGrow)/2,t); System.out.println(virus%mod); } public static long pow(long a, long b){ long result = 1L; while(b > 0){ if(b%2 == 1) result = (result*a)%mod; a = (a*a)%mod; b/=2; } return result%mod; } }