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