#!/bin/python3 import sys a,b,t = input().strip().split(' ') a,b,t = [int(a),int(b),int(t)] print((int)(pow((int)(0.5*(a+b)), t, 10**9 + 7)))