import sys line = sys.stdin.readline().strip('\n').split() a = int(line[0]) b = int(line[1]) t = int(line[2]) num = pow(int((0.5*(a + b))), int(t), (pow(10, 9) + 7)) print(num)