using System; using System.Collections.Generic; using System.IO; using System.Numerics; class Solution { static ulong power(ulong x, ulong y) { ulong res = 1; while (y > 0) { // If y is odd, multiply x with result if (y % 2 != 0) res = res * x % 1000000007; y = y>>1; // y = y/2 x = x * x % 1000000007; // Change x to x^2 } return res; } static void Main(String[] args) { /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution */ ulong[] temp = Array.ConvertAll(Console.ReadLine().Split(' '),ulong.Parse); ulong semiResult = ((temp[0] + temp[1]) / 2); ulong finalResult = power(semiResult, temp[2]); Console.WriteLine(finalResult); } }