#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx")
using namespace std;
using Int = long long;
template <class T1, class T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &a) {
  return os << "(" << a.first << ", " << a.second << ")";
};
template <class T>
void pv(T a, T b) {
  for (T i = a; i != b; ++i) cerr << *i << " ";
  cerr << endl;
}
template <class T>
void chmin(T &t, const T &f) {
  if (t > f) t = f;
}
template <class T>
void chmax(T &t, const T &f) {
  if (t < f) t = f;
}
struct ModInt {
  static int M;
  int x;
  constexpr ModInt() : x(0) {}
  ModInt(long long x_) : x(x_ % M) {
    if (x < 0) x += M;
  }
  ModInt &operator+=(const ModInt &a) {
    x += a.x;
    if (x >= M) x -= M;
    return *this;
  }
  ModInt &operator-=(const ModInt &a) {
    x -= a.x;
    if (x < 0) x += M;
    return *this;
  }
  ModInt &operator*=(const ModInt &a) {
    x = static_cast<int>((static_cast<long long>(x) * a.x) % M);
    return *this;
  }
  ModInt operator+(const ModInt &a) const { return (ModInt(*this) += a); }
  ModInt operator-(const ModInt &a) const { return (ModInt(*this) -= a); }
  ModInt operator*(const ModInt &a) const { return (ModInt(*this) *= a); }
  ModInt operator-() const { return ModInt(-x); }
  ModInt pow(long long e) const {
    ModInt x2 = x, xe = 1;
    for (; e; e >>= 1) {
      if (e & 1) xe *= x2;
      x2 *= x2;
    }
    return xe;
  }
  ModInt inv() const {
    int a = x, b = M, y = 1, z = 0, t;
    for (;;) {
      t = a / b;
      a -= t * b;
      if (a == 0) {
        assert(b == 1 || b == -1);
        return ModInt(b * z);
      }
      y -= t * z;
      t = b / a;
      b -= t * a;
      if (b == 0) {
        assert(a == 1 || a == -1);
        return ModInt(a * y);
      }
      z -= t * y;
    }
  }
  friend ModInt operator+(long long a, const ModInt &b) {
    return (ModInt(a) += b);
  }
  friend ModInt operator-(long long a, const ModInt &b) {
    return (ModInt(a) -= b);
  }
  friend ModInt operator*(long long a, const ModInt &b) {
    return (ModInt(a) *= b);
  }
  friend std::ostream &operator<<(std::ostream &os, const ModInt &a) {
    return os << a.x;
  }
};
int ModInt::M;
using Mint = ModInt;
constexpr int LIM = 105;
Mint inv[110], fac[110], invFac[110];
Mint pw[110][110];
Mint pw1[110][110];
int A, B, K, D;
Mint dp[42][42][42][42][2][42];
int main() {
  for (; ~scanf("%d%d%d%d", &A, &B, &K, &D);) {
    Mint::M = D;
    inv[1] = 1;
    for (int i = 2; i < LIM; ++i) {
      inv[i] = -(Mint::M / i) * inv[Mint::M % i];
    }
    fac[0] = invFac[0] = 1;
    for (int i = 1; i < LIM; ++i) {
      fac[i] = fac[i - 1] * i;
      invFac[i] = invFac[i - 1] * inv[i];
    }
    for (int r = 0; r < LIM; ++r) {
      pw[r][0] = 1;
      for (int i = 1; i < LIM; ++i) {
        pw[r][i] = pw[r][i - 1] * r;
      }
    }
    for (int r = 0; r < LIM; ++r) {
      pw1[r][0] = 1;
      for (int i = 1; i < LIM; ++i) {
        pw1[r][i] = pw1[r][i - 1] * r * inv[r + 1];
      }
    }
    for (int a = 0; a <= A; ++a)
      for (int b = 0; b <= B; ++b) {
        for (int p = 0; p <= a; ++p)
          for (int q = 0; q <= b; ++q) {
            for (int s = 0; s < 2; ++s)
              for (int c = 0; c <= A; ++c) {
                dp[a][b][p][q][s][c] = 0;
              }
          }
      }
    dp[0][0][0][0][0][0] = 1;
    for (int k = K; k >= 1; --k) {
      for (int a = 0; a < A; ++a)
        for (int b = 0; b <= B; ++b) {
          for (int p = 0; p <= a; ++p)
            for (int q = 0; q <= b; ++q) {
              for (int s = 0; s < 2; ++s)
                for (int c = 0; c <= a; ++c) {
                  dp[a + 1][b][p + 1][q][s][c + 1] +=
                      dp[a][b][p][q][s][c] * pw[k][b] * pw[K - k + 1][B - b];
                  dp[a + 1][b][p + 1][q][s ^ 1][c] +=
                      dp[a][b][p][q][s][c] * pw[k][b] * pw[K - k][B - b];
                }
            }
        }
      for (int a = 0; a <= A; ++a)
        for (int b = 0; b < B; ++b) {
          for (int p = 0; p <= a; ++p)
            for (int q = 0; q <= b; ++q) {
              for (int s = 0; s < 2; ++s)
                for (int c = 0; c <= a; ++c) {
                  dp[a][b + 1][p][q + 1][s][c] +=
                      dp[a][b][p][q][s][c] * pw[k][a] * pw[K - k + 1][A - a];
                  dp[a][b + 1][p][q + 1][s ^ 1][c] +=
                      dp[a][b][p][q][s][c] * pw[k][a] * pw[K - k][A - a] *
                      pw1[K - k][c];
                }
            }
        }
      for (int a = 0; a <= A; ++a)
        for (int b = 0; b <= B; ++b) {
          Mint sum = 0;
          for (int p = 0; p <= a; ++p)
            for (int q = 0; q <= b; ++q) {
              Mint tmp = 0;
              for (int s = 0; s < 2; ++s)
                for (int c = 0; c <= a; ++c) {
                  s ? (tmp -= dp[a][b][p][q][s][c])
                    : (tmp += dp[a][b][p][q][s][c]);
                  dp[a][b][p][q][s][c] = 0;
                }
              sum += tmp * invFac[p] * invFac[q];
            }
          dp[a][b][0][0][0][0] = sum;
        }
    }
    Mint ans = dp[A][B][0][0][0][0];
    ans *= fac[A] * fac[B];
    printf("%d\n", ans.x);
  }
  return 0;
}
