#include #include int main() { using namespace std; using modint = atcoder::static_modint<1000000007>; unsigned long N, M, K; cin >> N >> M >> K; vector ans(K + 1); if(N == 1)for(unsigned long i{1}; i <= K; ++i)ans[i] = modint::raw(i) * modint::raw(i - 1).pow(M - 1); else if(N == 2)for(unsigned long i{1}; i <= K; ++i)ans[i] = modint{i * i - i} * modint{(i - 3) * i + 3}.pow(M - 1); else for(unsigned long i{1}; i <= K; ++i){ const auto I{modint::raw(i)}; auto a{(I - 2) * ((I - 3) * I + 5)}; auto b{(I - 1) * (((I - 6) * I + 13) * I - 11)}; auto c{I * (I - 1) * (I - 1)}; auto d{I * (I - 1) * ((I - 3) * I + 1)}; unsigned long n{M - 1}; while(n){ if(n & 1){ c = a * c - d; d = b * d; }else{ d = a * d - b * c; } a = a * a - 2 * b; b = b * b; n /= 2; } ans[i] = c; } vector coef(K + 1); coef[0] = 1; for(unsigned long i{}; i < K; ++i)coef[i + 1] = coef[i] * (K - i); modint c{1}; for(unsigned long i{K + 1}; i; --i)coef[i - 1] *= (c *= -modint::raw(i)); cout << (inner_product(begin(ans), end(ans), begin(coef), modint{}) / coef[K]).val() << endl; return 0; }