b,c,d=map(int,input().split()) M=10**9+7 print(b*c*(1-pow(c,d,M))*pow(1-c,M-2,M)%M if c>1 else b*d)