import java.util.Scanner; public class Solution { private static final int M = 1000000000 + 7; public static void main(String[] args) { try (Scanner scanner = new Scanner(System.in)) { byte a = scanner.nextByte(); byte b = scanner.nextByte(); long t = scanner.nextLong(); int c = (a + b) / 2; long result = powMod(c, t); System.out.println(result); } } public static long powMod(long n, long k) { if (k == 1) { return n % M; } if (k % 2 == 0) { return powMod((n * n) % M, k / 2) % M; } return (n * powMod(n, k - 1)) % M; } }