import sys #input = sys.stdin.readline input = sys.stdin.buffer.readline def mat_dot(A, B, MOD=pow(10,9)+7): #A:n*m行列, B:m*l行列 n, m, l = len(A), len(A[0]), len(B[0]) X = [[0]*l for i in range(n)] for i in range(n): for j in range(l): temp = 0 for k in range(m): temp = (temp + A[i][k] * B[k][j]) % MOD X[i][j] = temp return X def mat_pow(A, x, MOD): #A^x n = len(A) X = [[0] * n for i in range(n)] for i in range(n): X[i][i] = 1 for i in range(x.bit_length()): if (x>>i)&1: X = mat_dot(X, A, MOD) A = mat_dot(A, A, MOD) return X def main(): C,N,M = map(int,input().split()); MOD = pow(10,9) + 7 invc = pow(C,MOD-2,MOD) X = [[invc,0,1,0],[0,invc,0,1],[0,invc,0,0],[1-invc,1-2*invc,0,0]] v = [[1],[0],[0],[0],[0],[0]] XN = mat_pow(X,N,MOD) g = mat_dot(XN,v,MOD) #print(XN) #1台の時、それがAにいない確率 p = 1 - g[0][0] ans = 1 - pow(p,M,MOD) print(ans%MOD) if __name__ == '__main__': main()