import java.io.*; import java.util.*; public class Solution { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int a = scanner.nextInt(); int b = scanner.nextInt(); long time = scanner.nextLong(); int step = (a + b) / 2; long result = power(step, time, 1000000007); System.out.println(result); } static long power(long x, long y, int p) { long result = 1; x = x % p; while (y > 0) { if (y % 2 == 1) { result = (result * x) % p; } y = y / 2; x = (x * x) % p; } return result; } }