#include <bits/stdc++.h>

const int N = 110;

int dp[N][N][N][2];
int moder;
int comb[N][N], power[N][N];

void addmult(int &a, int b, int c){a = (a + 1ll * b * c) % moder;}

int main(){
    int n, m, k;
    scanf("%d%d%d%d", &n, &m, &k, &moder);
    for (int i = 0; i < N; ++ i){
        comb[i][0] = 1;
        for (int j = 1; j <= i; ++ j){
            comb[i][j] = (comb[i - 1][j - 1] + comb[i - 1][j]) % moder;
        }
        power[i][0] = 1;
        for (int j = 1; j < N; ++ j){
            power[i][j] = 1ll * power[i][j - 1] * i % moder;
        }
    }
    dp[1][0][0][0] = 1;
    for (int i = 1; i <= k; ++ i){
        for (int j = 0; j <= n; ++ j){
            for (int K = 0; K <= m; ++ K){
                int now = dp[i][j][K][0], coe1 = power[k - i + 1][j], coe2 = power[i][n - j] - power[i - 1][n - j];
                coe2 += coe2 < 0 ? moder : 0;
                int coe = 1ll * coe1 * coe2 % moder;
                for (int u = 0; K + u <= m; ++ u){
                    addmult(dp[i][j][K + u][1], now, comb[m - K][u]);
                    now = 1ll * coe * now % moder;
                }
            }
        }
        for (int j = 0; j <= n; ++ j){
            for (int K = 0; K <= m; ++ K){
                int now = dp[i][j][K][1], coe1 = power[k - i + 1][K] - power[k - i][K], coe2 = power[i][m - K];
                coe1 += coe1 < 0 ? moder : 0;
                int coe = 1ll * coe1 * coe2 % moder;
                for (int u = 0; j + u <= n; ++ u){
                    addmult(dp[i + 1][j + u][K][0], now, comb[n - j][u]);
                    now = 1ll * coe * now % moder;
                }
            }
        }
    }
    printf("%d\n", dp[k + 1][n][m][0]);
    return 0;
}
