#!/bin/python import sys a, b, t = map(int,raw_input().strip().split(' ')) sum = 1 x = int((a*0.5) + (b*0.5)) y = 1 while t > 1: if t % 2 == 1: sum = (x * sum) % 1000000007 x = (x * x) % 1000000007 t = t / 2 sum = (x * sum) % 1000000007 print sum