import java.math.BigInteger; import java.util.Scanner; public class Solution { public static void main(String[]args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); int sum = (a + b) / 2; BigInteger t = sc.nextBigInteger(); BigInteger cells = BigInteger.valueOf(sum); BigInteger x = BigInteger.valueOf(1000000007); cells = cells.modPow(t, x); System.out.print(cells); } }