#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

#define For(x,y,z) for(int x=y;x<=z;++x)

const int N = 101;
int pw[N][N*N], fac[N], inv[N];
int f[N][N], g[N][N], coe[N][N];
int n, m, K, p;

inline int qpow(int A, int B) {
	int r = 1; while(B) {
		if(B&1) r = (ll)r * A%p;
		A = (ll)A * A%p, B >>= 1;
	} return r;
}

int main() {
	scanf("%d%d%d%d", &n, &m, &K, &p);
	
	for(int i = 0; i <= K; ++ i) {
		pw[i][0] = 1;
		for(int j = 1; j <= n * m; ++ j)
			pw[i][j] = (ll)pw[i][j-1] * i%p;
	}
	
	int t = n;
	if(n < m) t = m;
	fac[0] = 1;
	for(int i = 1; i <= t; ++ i) fac[i] = (ll)fac[i-1] * i%p;
	inv[t] = qpow(fac[t], p-2);
	for(int i = t; i; -- i) inv[i-1] = (ll)inv[i] * i%p;
	
	g[0][0] = 1;
	For(t, 1, K) {
		swap(f, g);
		For(i, 0, n) For(j, 0, m)
			coe[i][j] = (ll)pw[t][i*(m-j)] * pw[K-t+1][i*j]%p * inv[i]%p;
		For(i, 0, n) For(j, 0, m) {
			int&v = g[i][j]; v = 0;
			For(k, 0, i)
				v = (v + (ll)f[i-k][j] * coe[k][j])%p;
		}
		/* definited row*/
		
		swap(f, g);
		For(i, 0, n) For(j, 0, m)
			coe[i][j] = (ll)pw[t][j*(n-i)] * pw[K-t+1][i*j]%p * inv[j]%p;
		For(i, 0, n) For(j, 0, m) {
			int&v = g[i][j]; v = 0;
			For(k, 0, j)
				v = (v + (ll)f[i][j-k] * coe[i][k])%p;
		}
		/* definited column */
		
		swap(f, g);
		For(i, 0, n) For(j, 0, m) {
			coe[i][j] = (ll)pw[t][i*(m-j)] * pw[K-t][i*j]%p * inv[i]%p;
			if(i&1) coe[i][j] = (ll)coe[i][j] * (p-1)%p;
		}
		For(i, 0, n) For(j, 0, m) {
			int&v = g[i][j]; v = 0;
			For(k, 0, i)
				v = (v + (ll)f[i-k][j] * coe[k][j])%p;
		}
		
		swap(f, g);
		For(i, 0, n) For(j, 0, m) {
			coe[i][j] = (ll)pw[t][j*(n-i)] * pw[K-t][i*j]%p * inv[j]%p;
			if(j&1) coe[i][j] = (ll)coe[i][j] * (p-1)%p;
		}
		For(i, 0, n) For(j, 0, m) {
			int&v = g[i][j]; v = 0;
			For(k, 0, j)
				v = (v + (ll)f[i][j-k] * coe[i][k])%p;
		}
	}
	
	printf("%lld\n", (ll)f[n][m] * fac[n]%p * fac[m]%p);
	return 0;
}