using System; using System.Collections.Generic; using System.IO; using System.Numerics; class Solution { static void Main(String[] args) { ulong[] tokens = Array.ConvertAll(Console.ReadLine().Split(' '), UInt64.Parse); ulong a = tokens[0]; ulong b = tokens[1]; ulong t = tokens[2]; double aResult = a * .5D; double bResult = b * .5D; BigInteger cells = new BigInteger(aResult + bResult); BigInteger power = new BigInteger(t); BigInteger mod = new BigInteger(Math.Pow(10, 9) + 7D); BigInteger cellCount = BigInteger.ModPow(cells, power, mod); // BigInteger bigInt = new BigInteger(cells); //BigInteger bigInt = BigInteger.Pow(cells, t); Console.WriteLine(cellCount); //ulong result = (ulong)(Math.Pow(cells, t)) % (ulong)(Math.Pow(10, 9) + 7D); //Console.WriteLine(result); } }