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[] input = Console.ReadLine().Split(' '); int a = Convert.ToInt32(input[0]); int b = Convert.ToInt32(input[1]); ulong t = Convert.ToUInt64(input[2]); Console.WriteLine(power2((Convert.ToUInt64(0.5*(a+b))),t, 1000000007)); } static ulong recursivePower(ulong x, ulong y) { ulong temp; if (y == 0) return 1 % 1000000007; if (y == 1) return x % 1000000007; temp = recursivePower(x, y / 2); if (y % 2 == 0) return (temp * temp) % 1000000007; else return (x * temp * temp) % 1000000007; } static ulong power2(ulong x, ulong y, ulong mod) { ulong res = 1; x = x % mod; while(y > 0) { if(y%2 != 0) { res = (res * x) % mod; } y = y / 2; x = (x * x) % mod; } return res; } }