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) exit() s=b*c*pow(c-1,md-2,md) ans=((b*c+s)*pow(c,d-1,md)-s)%md print(ans) main()