import java.io.*; import java.util.*; public class Solution { public static long power(long x, long y, long p) { long res = 1; x = x%p; while (y > 0) { // If y is odd, multiply x with result if (y%2!=0) res = (res*x) % p; // y must be even now y = y/2; x = (x*x) % p; } return res; } 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 s = new Scanner(System.in); long a = s.nextLong(); long b = s.nextLong(); long t = s.nextLong(); long k= (a+b)/2; long output = power(k,t,1000000007); System.out.println(output); } }