import java.io.*; import java.util.*; import java.math.BigInteger; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); BigInteger t = new BigInteger(sc.next()); int c = (a + b)/2; BigInteger base = new BigInteger("" + c); BigInteger result = base.modPow(t, new BigInteger("1000000007")); System.out.println(result); /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ } }