def power(x,y): if y == 0: return 1 temp = power(x, y/2) if y%2 == 0: return temp*temp%1000000007 else: return (x*temp*temp)%1000000007 a = map(int, raw_input().split()) print (power(((a[0]+a[1])/2),a[2]))%1000000007