import java.io.*; import java.util.*; import java.math.*; public class Solution { public static void main(String[] args) { /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ Scanner scan = new Scanner(System.in); int a, b; BigInteger t; a = scan.nextInt(); b = scan.nextInt(); t = scan.nextBigInteger(); Integer coefficient = (int) (0.5*a + 0.5*b); BigInteger c = new BigInteger(coefficient.toString()); BigInteger mod = new BigInteger(Integer.toString((int)Math.pow(10, 9) + 7)); BigInteger e = new BigInteger(t.toString()); BigInteger answer = c.modPow(e, mod); System.out.println(answer); } }