using System; using System.Collections.Generic; using System.IO; class Solution { static void Main(String[] args) { string[] line = Console.ReadLine().Split(' '); uint x = (uint)( int.Parse(line[0]) + int.Parse(line[1]) ) / 2; ulong pow = Convert.ToUInt64(line[2]); ulong result = PowerWithModulo(x, pow); Console.WriteLine(result); } static ulong PowerWithModulo(uint x, ulong pow) { ulong temp; if( pow == 0) return 1; temp = PowerWithModulo(x, pow/2) % 1000000007; if (pow%2 == 0) return ( temp * temp ) % 1000000007; else return (( x % 1000000007 ) * (( temp * temp ) % 1000000007)) % 1000000007; } }