using System; namespace ExtremelyDangerousVirus { class Program { private static ulong Power(ulong x, ulong y, ulong p) { ulong res = 1; x = x % p; while (y > 0) { if (y % 2 != 0) res = (res * x) % p; y = y >> 1; x = (x * x) % p; } return res; } static void Main(string[] args) { var tokens = Console.ReadLine().Split(' '); var a = Convert.ToUInt64(tokens[0]); var b = Convert.ToUInt64(tokens[1]); var t = Convert.ToUInt64(tokens[2]); ulong c = (a + b) / 2; Console.WriteLine(Power(c, t, 1000000007)); } } }