line = input().split(' ') a = int(line[0]) b = int(line[1]) t = int(line[2]) temp = (.5 * (a + b)) temp = pow(int(temp), t, 1000000007) print(temp)