using System; using System.Collections.Generic; using System.IO; using System.Numerics; class Solution { static void Main(String[] args) { int m = 1000000007; var x = Array.ConvertAll(Console.ReadLine().Split(' '), s => BigInteger.Parse(s)); var i = (x[1] + x[0]) / 2; var r = BigInteger.ModPow(i, x[2], m) ; Console.WriteLine(r); } }