def power(x,y): if y == 0 : return 1 elif y ==1: return x elif y == -1: return 1/float(x) elif y%2 ==0: tmp = power(x,y//2) return (tmp*tmp)%(10**9+7) else: tmp = power(x,y//2) if y > 0 : return (x*tmp*tmp)%(10**9+7) elif y == -3: return ((tmp)/float(x))%(10**9+7) else : return (tmp*tmp /float(x))%(10**9+7) a = raw_input().split() a = map(int, a) x=(a[0]+a[1])/2 t=a[2] ans=power(x,t) print ans%(10**9+7)