#include <bits/stdc++.h>
int N, M, K, D;
int C[105][105], pw[105][10205], f[105][4][105][105];
int main() {
  scanf("%d%d%d%d", &N, &M, &K, &D);
  f[K][3][N][M] = 1;
  for (int i = 0; i <= 101; i++) {
    for (int j = *C[i] = 1; j <= i; j++)
      C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]) % D;
    for (int j = *pw[i] = 1; j <= 10201; j++)
      pw[i][j] = 1ll * pw[i][j - 1] * i % D;
  }
  for (int x = K; x; x--) {
    for (int ty = 4; ty--;) {
      for (int i = 0; i <= N; i++) {
        for (int j = 0, F; j <= M; j++)
          if (F = f[x][ty][i][j]) {
            if (ty == 3) {
              for (int y = 0; y <= i; y++)
                f[x][2][i - y][j] =
                    (f[x][2][i - y][j] +
                     1ll * F * (y & 1 ? D - C[i][y] : C[i][y]) % D *
                         pw[K - x][y * j] % D * pw[x][y * (M - j)]) %
                    D;
            }
            if (ty == 2) {
              for (int y = 0; y <= j; y++)
                f[x][1][i][j - y] =
                    (f[x][1][i][j - y] +
                     1ll * F * (y & 1 ? D - C[j][y] : C[j][y]) % D *
                         pw[K - x][y * i] % D * pw[x][y * (N - i)]) %
                    D;
            }
            if (ty == 1) {
              for (int y = 0; y <= i; y++)
                f[x][0][i - y][j] =
                    (f[x][0][i - y][j] + 1ll * F * C[i][y] % D *
                                             pw[K - x + 1][y * j] % D *
                                             pw[x][y * (M - j)]) %
                    D;
            }
            if (ty == 0) {
              for (int y = 0; y <= j; y++)
                f[x - 1][3][i][j - y] =
                    (f[x - 1][3][i][j - y] + 1ll * F * C[j][y] % D *
                                                 pw[K - x + 1][y * i] % D *
                                                 pw[x][y * (N - i)]) %
                    D;
            }
          }
      }
    }
  }
  printf("%d\n", f[0][3][0][0]);
}
