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. */ PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)), false); Scanner stdin = new Scanner(System.in); int a_prob = stdin.nextInt(); int b_prob = stdin.nextInt(); BigInteger base = BigInteger.valueOf((a_prob+b_prob)/2); BigInteger t = BigInteger.valueOf(stdin.nextLong()); BigInteger mod = new BigInteger("1000000007"); out.println(base.modPow(t,mod).longValue()); out.close(); } }