c,n,m = map(int,input().split()) mod = 10**9+7 cinv = pow(c,mod-2,mod) A = [[cinv,0,0,cinv],[0,cinv,(c-1)*cinv%mod,(c-2)*cinv%mod],[1,0,0,0],[0,1,0,0]] def calc(X,Y): ans = [[0]*4 for i in range(4)] for i in range(4): for j in range(4): for k in range(4): ans[i][j] += X[i][k]*Y[k][j] ans[i][j] %= mod return ans base = [[0]*4 for i in range(4)] for i in range(4): base[i][i] = 1 while n: if n%2: base = calc(A,base) n //= 2 A = calc(A,A) p = (base[2][0]*cinv+base[2][2])%mod ans = (1-pow(1-p,m,mod))%mod print(ans)