using System; using System.Collections.Generic; using System.IO; class Solution { static void Main(String[] args) { /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution */ string[] arr_temp = Console.ReadLine().Split(' '); long a = 0; long b = 0; long t = 0; long.TryParse(arr_temp[0], out a); long.TryParse(arr_temp[1], out b); long.TryParse(arr_temp[2], out t); long k = (long) ((0.5 * a) + (0.5 * b)); long x = (long)power(k, t, 1000000007); //Int64 r = Convert.ToInt64(x % power(10, 9, 7)); Console.WriteLine(x); } static long power(long x, long y, int 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 > 0) res = (res * x) % p; // y must be even now y = y >> 1; // y = y/2 x = (x * x) % p; } return res; } }