# Enter your code here. Read input from STDIN. Print output to STDOUT import sys from heapq import * def readInt(): return int(input()) def readNInt(): return map(int, sys.stdin.readline().split()) def readList(): return list(map(int, sys.stdin.readline().split())) def virus(): a,b,t = readNInt() print pow((a+b)/2,t,10**9 + 7) virus()