using System; using System.Collections.Generic; using System.IO; using System.Numerics; 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 wolo = Console.ReadLine(); string[] numeros = Console.ReadLine().Split(' '); ulong a = ulong.Parse(numeros[0].ToString()) , b = ulong.Parse(numeros[1].ToString()) ; ulong t = ulong.Parse(numeros[2].ToString()); BigInteger virus = 1 ; // virus = (((( (a * 1) / 2 ) + ((b * 1) /2 )) + (( (a * t) / 2) + ((b * t) / 2))) * t) / 2 ; virus = BigInteger.ModPow(((a+b)/2) ,t,1000000007); //ulong respuesta = virus % (1000000007); Console.WriteLine(virus); } static ulong power(ulong x, ulong y) { ulong temp; if( y == 0) return 1; temp = power(x , y/2); if (y%2 == 0) return (temp*temp) % (1000000007) ; else return (x*temp*temp) % (1000000007) ; } }