func_code_string: #include <bits/stdc++.h>   using namespace std;   int n, m, K;   long long dp[1005];   long long quick_sqr(long long g, int K) {     long long ret = 1;     while (K) {       if (K & 1) ret = ret * g % 1000000007;       g = g * g % 1000000007;       K >>= 1;     }     return ret;   }   long long sum[1000050], psum[1000050];   inline long long C(int a, int b) {     return sum[a] * psum[b] % 1000000007 * psum[a - b] % 1000000007;   }   int main() {     sum[0] = psum[0] = 1;     for (int i = 1; i < 1000050; i++) {       sum[i] = sum[i - 1] * i % 1000000007;       psum[i] = quick_sqr(sum[i], 1000000007 - 2);     }     scanf( %d%d%d , &n, &m, &K);     for (int i = 1; i <= n; i++) {       dp[i] = quick_sqr(i, n);       for (int k = 1; k < i; k++) {         dp[i] += 1000000007 - C(i, k) * dp[k] % 1000000007;         dp[i] %= 1000000007;       }     }     long long A = 1, ans = 0;     if (m == 1) {       printf( %I64d n , quick_sqr(K, n));       return 0;     }     if (m == 2) {       for (int j = 1, i = 0; i + j * 2 <= K && i + j <= n; j++) {         ans += dp[i + j] * dp[i + j] % 1000000007 * C(K, i) % 1000000007 *                C(K - i, j) % 1000000007 * C(K - i - j, j) % 1000000007 *                quick_sqr(i, n * (m - 2)) % 1000000007;         if (ans >= 1000000007) ans -= 1000000007;       }     }     for (int i = 1; i <= min(n, K); i++)       for (int j = 0; i + j * 2 <= K && i + j <= n; j++) {         ans += dp[i + j] * dp[i + j] % 1000000007 * C(K, i) % 1000000007 *                C(K - i, j) % 1000000007 * C(K - i - j, j) % 1000000007 *                quick_sqr(i, n * (m - 2)) % 1000000007;         if (ans >= 1000000007) ans -= 1000000007;       }     printf( %I64d n , ans);   }   