import sys sys.setrecursionlimit(10 ** 6) def MI(): return map(int, sys.stdin.readline().split()) def main(): md = 10 ** 9 + 7 b,c,d=MI() if c==1: print(b*d%md) exit() ans=b*c*(pow(c,d,md)-1)*pow(c-1,md-2,md)%md print(ans) main()