import sys n = sys.stdin.read().strip().split() a = int(n[0]) b = int(n[1]) t = int(n[2]) print(pow((a+b)//2, t, 1000000007))