#include <bits/stdc++.h>
using namespace std;
const int N = 100 + 10, M = N * N;
int rd() {
  int x = 0, w = 1;
  char ch = 0;
  while (ch < '0' || ch > '9') {
    if (ch == '-') w = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + (ch ^ 48);
    ch = getchar();
  }
  return x * w;
}
int mod;
void ad(int &x, int y) { x += y, x -= x >= mod ? mod : 0; }
int fpow(int a, int b) {
  int an = 1;
  while (b) {
    if (b & 1) an = 1ll * an * a % mod;
    a = 1ll * a * a % mod, b >>= 1;
  }
  return an;
}
int ginv(int a) { return fpow(a, mod - 2); }
vector<int> e[N];
int n, m, k, c[N][N], pw[N][M], f[2][N][N];
int main() {
  n = rd(), m = rd(), k = rd(), mod = rd();
  for (int i = 0; i <= N - 5; ++i) {
    c[i][0] = 1;
    for (int j = 1; j <= i; ++j)
      c[i][j] = (c[i - 1][j] + c[i - 1][j - 1]) % mod;
  }
  for (int i = 0; i <= N - 5; ++i) {
    pw[i][0] = 1;
    for (int j = 1; j <= M - 5; ++j) pw[i][j] = 1ll * pw[i][j - 1] * i % mod;
  }
  int nw = 1, la = 0, dx;
  f[la][0][0] = 1;
  for (int h = 1; h <= k; ++h)
    for (int o = 0; o <= 1; ++o) {
      for (int i = 0; i <= n; ++i)
        for (int j = 0; j <= m; ++j) {
          if (!f[la][i][j]) continue;
          for (int l = 0; i + l <= n; ++l) {
            dx = 1ll * f[la][i][j] * c[n - i][l] % mod *
                 pw[k - h + 1 - o][l * j] % mod * pw[h][l * (m - j)] % mod;
            ad(f[nw][i + l][j], (o && (l & 1)) ? mod - dx : dx);
          }
          f[la][i][j] = 0;
        }
      nw ^= 1, la ^= 1;
      for (int i = 0; i <= n; ++i)
        for (int j = 0; j <= m; ++j) {
          if (!f[la][i][j]) continue;
          for (int l = 0; j + l <= m; ++l) {
            dx = 1ll * f[la][i][j] * c[m - j][l] % mod *
                 pw[k - h + 1 - o][l * i] % mod * pw[h][l * (n - i)] % mod;
            ad(f[nw][i][j + l], (o && (l & 1)) ? mod - dx : dx);
          }
          f[la][i][j] = 0;
        }
      nw ^= 1, la ^= 1;
    }
  printf("%d\n", f[la][n][m]);
  return 0;
}
