#include <bits/stdc++.h>
using namespace std;
template <typename A, typename B>
ostream& operator<<(ostream& os, const pair<A, B>& x) {
  return os << "(" << x.first << "," << x.second << ")";
}
int MOD;
struct Mint {
  int val;
  Mint() { val = 0; }
  Mint(const long long& x) {
    val = (-MOD <= x && x < MOD) ? x : x % MOD;
    if (val < 0) val += MOD;
  }
  friend bool operator==(const Mint& a, const Mint& b) {
    return a.val == b.val;
  }
  friend bool operator!=(const Mint& a, const Mint& b) { return !(a == b); }
  friend bool operator<(const Mint& a, const Mint& b) { return a.val < b.val; }
  Mint& operator+=(const Mint& m) {
    if ((val += m.val) >= MOD) val -= MOD;
    return *this;
  }
  Mint& operator-=(const Mint& m) {
    if ((val -= m.val) < 0) val += MOD;
    return *this;
  }
  Mint& operator*=(const Mint& m) {
    val = (long long)val * m.val % MOD;
    return *this;
  }
  friend Mint modex(Mint a, long long p) {
    Mint ans = 1;
    for (; p; p >>= 1, a *= a)
      if (p & 1) ans *= a;
    return ans;
  }
  Mint& operator/=(const Mint& m) { return *this *= modex(m, MOD - 2); }
  Mint& operator++() { return *this += 1; }
  Mint& operator--() { return *this -= 1; }
  Mint operator++(int) {
    Mint result(*this);
    *this += 1;
    return result;
  }
  Mint operator--(int) {
    Mint result(*this);
    *this -= 1;
    return result;
  }
  Mint operator-() const { return Mint(-val); }
  friend Mint operator+(Mint a, const Mint& b) { return a += b; }
  friend Mint operator-(Mint a, const Mint& b) { return a -= b; }
  friend Mint operator*(Mint a, const Mint& b) { return a *= b; }
  friend Mint operator/(Mint a, const Mint& b) { return a /= b; }
  friend ostream& operator<<(ostream& os, const Mint& x) { return os << x.val; }
};
bool done[105][105][105][2];
Mint dp[105][105][105][2];
int N, M, K;
const int MAXN = 105;
Mint binom[MAXN][MAXN];
Mint solve(int i, int j, int k, int t) {
  if (i == N && j == M) return 1;
  if (k == K + 1) return 0;
  Mint& ret = dp[i][j][k][t];
  if (done[i][j][k][t]) return ret;
  done[i][j][k][t] = true;
  ret = 0;
  if (t == 0) {
    ret += solve(i, j, k, 1);
    for (int r = 1; r <= N - i; ++r) {
      ret += modex(modex(Mint(k), M - j) - modex(Mint(k) - 1, M - j), r) *
             binom[N - i][r] * modex(Mint(K) - k + 1, j * r) *
             solve(i + r, j, k, 1);
    }
  } else {
    ret += solve(i, j, k + 1, 0);
    for (int c = 1; c <= M - j; ++c) {
      if (!i) break;
      if (c == M - j && i != N) continue;
      ret += modex(modex(Mint(K) - k + 1, i) - modex(Mint(K) - k, i), c) *
             binom[M - j][c] * modex(Mint(k), (N - i) * c) *
             solve(i, j + c, k + 1, 0);
    }
  }
  return ret;
}
int main() {
  scanf("%d%d%d%d", &N, &M, &K, &MOD);
  for (int i = 0; i < MAXN; ++i)
    for (int j = 0; j <= i; ++j)
      if (!j || j == i)
        binom[i][j] = 1;
      else
        binom[i][j] = binom[i - 1][j - 1] + binom[i - 1][j];
  Mint ans = solve(0, 0, 1, 0);
  printf("%d\n", ans.val);
}
