#yuki673 b,c,d=map(int,raw_input().split()) mod=1000000007 res=(pow(c,d,mod)+mod-1)*pow(c-1,mod-2,mod)*b%mod*c%mod if c==1: res=(b*d)%mod print res