import java.io.*; import java.util.*; import java.lang.*; public class Solution { private static long mod(long a) { return a % 1000000007; } private static long fastPow(long b, long n) { if (n == 0) { return 1; } if (n == 1) { return b; } long h = fastPow(b, n / 2); long f = mod(h * h); if (n % 2 == 0) { return f; } return mod(f * b); } public static void main(String[] args) { final Scanner in = new Scanner(System.in); int a = in.nextInt(); int b = in.nextInt(); long t = in.nextLong(); in.close(); long r = fastPow((a + b) / 2, t); System.out.println(r); } }