inText = input() a,b,t = map(int,inText.split(' ')) f = (10**9) + 7 ans = pow((int)((0.5* a) + 0.5*b), t, f) print(ans)