func_code_string: #include <bits/stdc++.h>   using namespace std;   long long ans;   int n, m, k;   long long C[1100][1100];   long long s1[1100][1100];   long long p[1100][1100];   long long f[1100100];   long long Pow(long long i, int x) {     long long tmp = 1;     while (x) {       if (x & 1) tmp = tmp * i % (1000000007LL);       i = i * i % (1000000007LL);       x >>= 1;     }     return tmp;   }   void work() {     memset(s1, 0, sizeof(s1));     int i = n;     for (int j = 1; j <= i; j++) {       s1[i][j] = Pow(j, i);       for (int k = 1; k < j; k++) {         s1[i][j] += (1000000007LL) - C[j][k] * s1[i][k] % (1000000007LL);         s1[i][j] %= (1000000007LL);       }     }   }   void pre() {     memset(C, 0, sizeof(C));     for (int i = 0; i <= 1000; i++) C[i][0] = 1;     for (int i = 1; i <= 1000; i++)       for (int j = 1; j <= i; j++)         C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]) % (1000000007LL);     f[0] = 1;     for (int i = 1; i <= 1000000; i++) f[i] = f[i - 1] * i % (1000000007LL);     for (int i = 1; i <= 1000; i++) p[i][0] = 1;     for (int i = 1; i <= 1000; i++)       for (int j = 1; j <= 1000; j++) {         p[i][j] = (p[i][j - 1] * i) % (1000000007LL);       }   }   long long Inv(long long x) { return Pow(x, (1000000007LL) - 2LL); }   long long C_(int x, int y) {     return f[x] * Inv(f[y]) % (1000000007LL) * Inv(f[x - y]) % (1000000007LL);   }   int main() {     pre();     while (~scanf( %d%d%d , &n, &m, &k)) {       ans = 0;       work();       long long tt;       if (m == 1) {         ans = Pow(k, n);       } else if (m > 2) {         for (int i = 1; i <= min(n, k); i++)           for (int j = 0; j + i <= min(n, k); j++) {             if ((i | j) && i + 2 * j <= k) {               tt = C_(k, i) * C_(k - i, j) % (1000000007LL) * C_(k - i - j, j) %                    (1000000007LL);               ans += ((s1[n][i + j] * s1[n][i + j]) % (1000000007LL) *                       Pow(i, (m - 2) * n) % (1000000007LL)) *                      tt % (1000000007LL);               ans %= (1000000007LL);             }           }       } else {         for (int i = 1; i <= min(n, k); i++) {           ans += C_(k, i) * s1[n][i] % (1000000007LL) * C_(k, i) %                  (1000000007LL) * s1[n][i] % (1000000007LL);           ans %= (1000000007LL);         }       }       printf( %I64d n , ans);     }     return 0;   }   