import java.math.BigInteger; import java.util.Scanner; public class D { public static void main(String[] args) { Scanner in = new Scanner(System.in); int a = in.nextInt(); int b = in.nextInt(); long t = in.nextLong(); BigInteger res = BigInteger.valueOf( (a + b) / 2 ).modPow( BigInteger.valueOf(t), BigInteger.valueOf(1_000_000_007) ); System.out.println(res); } }