s =raw_input() s=s.split() a = int(s[0]) b = int(s[1]) t = int(s[2]) res = pow(int(0.5*(a+b)),t,10**9+7) print int(res)