import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static void main(String[] args) { Scanner in = new Scanner(System.in); long a = in.nextLong(); long b = in.nextLong(); long t = in.nextLong(); long prob = power((a+b)/2, t, 1000000007); System.out.print(prob); } static long power(long x, long y, long p) { long res = 1; // Initialize result x = x % p; // Update x if it is more than or // equal to p while (y > 0) { // If y is odd, multiply x with result if (y%2!= 0) res = (res*x) % p; // y must be even now y = y/2; // y = y/2 x = (x*x) % p; } return res; } }