import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; 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 sc = new Scanner(System.in); long a = sc.nextInt(); long b = sc.nextInt(); long t = sc.nextInt(); long mod = 1000000000 + 7; long result = powmodn((long) (0.5 * (a + b)), t, mod); System.out.println(result); } public static long powmodn(long base, long exp, long mod) { long power = 2; long current = base * base; Map intermediates = new HashMap(); intermediates.put((long) 1, base); while (power < exp) { intermediates.put(power, current % mod); power *= 2; current *= current; } power /= 2; long exponent = exp; long result = 1; while (exponent > 0) { if (power <= exponent) { result = (result * intermediates.get(power)) % mod; exponent -= power; } power /= 2; } return result; } }