import java.io.*; import java.util.*; 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 in =new Scanner(System.in); int a=in.nextInt(); int b=in.nextInt(); long t=in.nextLong(); long x=(long) (0.5*(a+b)); long ans=power(x,t,1000000007); //int ans=(int)((0.5*a*t+0.5*b*t)%(Math.pow(10,9)+7)); System.out.println(ans); } public static long power(long x, long y, long p) { long res = 1; // Initialize result x = x % p; // Update x if it is more than or // equal to p while (y > 0) { // If y is odd, multiply x with result if (y%2==1) res = (res*x) % p; // y must be even now y = y/2; // y = y/2 x = (x*x) % p; } return res; } }