using System; class Solution { static int T = 1000000007; static void Main(String[] args) { string[] tokens = Console.ReadLine().Split(' '); int a = int.Parse(tokens[0]); int b = int.Parse(tokens[1]); long t = long.Parse(tokens[2]) % (T - 1); long cells = 1; long x = (long)((a + b) / 2); while (t > 0) { if (t % 2 > 0) { cells = (x * cells) % T; t = (t - 1) / 2; } else { t = t / 2; } x = (x * x) % T; } Console.WriteLine(cells); } }