using System; using System.Collections.Generic; using System.IO; using System.Numerics; class Solution { static void Main(String[] args) { string[] arr_temp = Console.ReadLine().Split(' '); Int64[] arr = Array.ConvertAll(arr_temp,Int64.Parse); Int64 a = arr[0]; Int64 b = arr[1]; Int64 t = arr[2]; Console.WriteLine(Expected(a, b, t)); } static int Expected(Int64 a, Int64 b, Int64 t){ BigInteger multiplier = new BigInteger(0.5 * (a + b)); BigInteger modulus = new BigInteger(1000000007); BigInteger expected = BigInteger.ModPow(multiplier, t, modulus); return (int) expected; } }