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