#include <bits/stdc++.h>
using namespace std;
int mod;
int ksm(int b, int n) {
  int res = 1;
  while (n) {
    if (n & 1) res = 1ll * res * b % mod;
    b = 1ll * b * b % mod;
    n >>= 1;
  }
  return res;
}
int f[2][105][105], pw[1005][10005], C[105][105];
void init(int n) {
  for (int i = 0; i <= n; ++i) {
    pw[i][0] = 1;
    for (int j = 1; j <= n * n; ++j) pw[i][j] = 1ll * pw[i][j - 1] * i % mod;
  }
  C[0][0] = 1;
  for (int i = 1; i <= n; ++i) {
    C[i][0] = 1;
    for (int j = 1; j <= i; ++j)
      C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]) % mod;
  }
}
void add(int &x, int y) { x = (x + y) % mod; }
signed main() {
  int n, m, K;
  cin >> n >> m >> K >> mod;
  init(100);
  f[0][0][0] = 1;
  int u = 0;
  for (int k = 1; k <= K; ++k) {
    for (int i = 0; i <= n; ++i)
      for (int j = 0; j <= m; ++j)
        if (f[u][i][j]) {
          for (int a = 0; i + a <= n; ++a)
            add(f[u ^ 1][i + a][j], 1ll * f[u][i][j] * C[n - i][a] % mod *
                                        pw[k][a * (m - j)] % mod *
                                        pw[K - k + 1][a * j] % mod);
        }
    u ^= 1;
    memset(f[u ^ 1], 0, sizeof(f[u ^ 1]));
    for (int i = 0; i <= n; ++i)
      for (int j = 0; j <= m; ++j)
        if (f[u][i][j]) {
          for (int b = 0; j + b <= m; ++b)
            add(f[u ^ 1][i][j + b], 1ll * f[u][i][j] * C[m - j][b] % mod *
                                        pw[k][b * (n - i)] % mod *
                                        pw[K - k + 1][b * i] % mod);
        }
    u ^= 1;
    memset(f[u ^ 1], 0, sizeof(f[u ^ 1]));
    for (int i = 0; i <= n; ++i)
      for (int j = 0; j <= m; ++j)
        if (f[u][i][j]) {
          int tmp;
          for (int a = 0; i + a <= n; ++a)
            tmp = 1ll * f[u][i][j] * C[n - i][a] % mod * pw[k][a * (m - j)] %
                  mod * pw[K - k][a * j] % mod,
            add(f[u ^ 1][i + a][j], (a & 1 ? mod - tmp : tmp));
        }
    u ^= 1;
    memset(f[u ^ 1], 0, sizeof(f[u ^ 1]));
    for (int i = 0; i <= n; ++i)
      for (int j = 0; j <= m; ++j)
        if (f[u][i][j]) {
          int tmp;
          for (int b = 0; j + b <= m; ++b)
            tmp = 1ll * f[u][i][j] * C[m - j][b] % mod * pw[k][b * (n - i)] %
                  mod * pw[K - k][b * i] % mod,
            add(f[u ^ 1][i][j + b], (b & 1) ? mod - tmp : tmp);
        }
    u ^= 1;
    memset(f[u ^ 1], 0, sizeof(f[u ^ 1]));
  }
  cout << f[u][n][m];
  return 0;
}
