a,b,t = map(int, raw_input().strip().split(" ")) m = 1000000007 factor = (a+b)/2 def fastPower(base,power,M): if power==0: return 1 if power==1: return base halfn=fastPower(base,power/2,M) if power%2==0: return ( halfn * halfn ) % M; else: return ( ( ( halfn * halfn ) % M ) * base ) % M; print fastPower(factor,t,m)