using System; using System.Collections.Generic; using System.IO; using System.Numerics; class Solution { static void Main(String[] args) { BigInteger[] tempInput = Array.ConvertAll(Console.ReadLine().Split(' '), BigInteger.Parse); ulong a = (ulong)tempInput[0]; ulong b = (ulong)tempInput[1]; BigInteger t = tempInput[2]; BigInteger numberOfCells = Power((BigInteger)(0.5*a + 0.5*b), t); Console.WriteLine(Modulo(numberOfCells)); } static BigInteger Modulo(BigInteger x){ return (BigInteger)(x%((BigInteger)Math.Pow(10, 9) + 7)); } static BigInteger Power(BigInteger x, BigInteger n){ BigInteger result = 1; x = Modulo(x); while (n > 0){ if (n%2 == 1){ result = Modulo(result * x); } n = n/2; x = Modulo(x*x); } return result; } }