from __future__ import print_function try: input = raw_input except: pass (a,b,t) = ( int(x) for x in input().strip().split(' ') ) m = 10**9+7 print(pow((a+b)//2,t,m))