# Enter your code here. Read input from STDIN. Print output to STDOUT input = raw_input().split(' ') #def calculate(a,b,initial_amount,total_time): def power(x, y): if( y == 0): return 1 temp = long(power(x, y/2)) if (y % 2 == 0): return temp*temp else: return x*temp*temp #print long(power( (long(input[0]) + long(input[1]))/2, long(input[2]))) % long(1000000007) print pow( (long(input[0]) + long(input[1]))/2, long(input[2]), 1000000007)