using System; using System.Collections; using System.Linq; class Solution { private static ulong Pow(ulong b, ulong e, ulong m) { var a = new BitArray(BitConverter.GetBytes(e)); int n; for (n = a.Count; n >= 0; --n) { if (a[n - 1]) { break; } } ulong result = 1; for (var i = 0; i < n; ++i) { if (a[i]) { result *= Pow2(b, i, m); result %= m; } } return result; } private static ulong Pow2(ulong b, int c, ulong m) { ulong result = b; for (var i = 0; i < c; ++i) { result *= result; result %= m; } return result; } static void Main(String[] args) { var input = Console.ReadLine().Split().Select(ulong.Parse).ToArray(); var a = input[0]; var b = input[1]; var t = input[2]; var modulo = (ulong)Math.Pow(10, 9) + 7; var count = Pow((a + b) / 2, t, modulo); Console.WriteLine(count); } }