#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
const int MAXH = 100;
const int MAXW = 100;
const int MAXDIM = 100;
const int MAXVAL = 100;
int h, w, mxval, mod;
void inc(int &a, int b) {
  if ((a += b) >= mod) a -= mod;
}
int dp[MAXH + 1][MAXW + 1];
int tdp[MAXH + 1][MAXW + 1];
int pw[MAXVAL + 1][MAXW + 1];
int choose[MAXDIM + 1][MAXDIM + 1];
int solve() {
  for (int val = (0); val <= (mxval); ++val) {
    pw[val][0] = 1;
    for (int y = (1); y <= (w); ++y)
      pw[val][y] = (long long)pw[val][y - 1] * val % mod;
  }
  for (int i = (0); i <= (MAXDIM); ++i) {
    choose[i][0] = choose[i][i] = 1;
    for (int j = (1); j < (i); ++j)
      choose[i][j] = (choose[i - 1][j - 1] + choose[i - 1][j]) % mod;
  }
  for (int x = (0); x <= (h); ++x)
    for (int y = (0); y <= (w); ++y) dp[x][y] = x == 0 && y == 0 ? 1 : 0;
  for (int val = (1); val <= (mxval); ++val) {
    for (int x = (0); x <= (h); ++x)
      for (int y = (0); y <= (w); ++y) tdp[x][y] = 0;
    for (int x = (0); x <= (h); ++x)
      for (int y = (0); y <= (w); ++y) {
        int eachrowcontrib = pw[val][w - y] - pw[val - 1][w - y];
        if (eachrowcontrib < 0) eachrowcontrib += mod;
        int eachrowvalue = pw[mxval - val + 1][y];
        int cur = dp[x][y],
            mlt = (long long)eachrowcontrib * eachrowvalue % mod;
        for (int dx = (0); dx <= (h - x); ++dx) {
          int now = (long long)choose[h - x][dx] * cur % mod;
          inc(tdp[x + dx][y], now);
          cur = (long long)cur * mlt % mod;
        }
      }
    for (int x = (0); x <= (h); ++x)
      for (int y = (0); y <= (w); ++y) dp[x][y] = 0;
    for (int x = (0); x <= (h); ++x)
      for (int y = (0); y <= (w); ++y) {
        int eachcolcontrib = pw[val][h - x];
        int eachcolvalue = pw[mxval - val + 1][x] - pw[mxval - val][x];
        if (eachcolvalue < 0) eachcolvalue += mod;
        int cur = tdp[x][y],
            mlt = (long long)eachcolcontrib * eachcolvalue % mod;
        for (int dy = (0); dy <= (w - y); ++dy) {
          int now = (long long)choose[w - y][dy] * cur % mod;
          inc(dp[x][y + dy], now);
          cur = (long long)cur * mlt % mod;
        }
      }
  }
  return dp[h][w];
}
void run() {
  scanf("%d%d%d%d", &h, &w, &mxval, &mod);
  printf("%d\n", solve());
}
int main() {
  run();
  return 0;
}
