#include <bits/stdc++.h>

using namespace std;

int pw[105][105],C[105][105];
int dp[2][105][105];

int main()
{
	int n,m,k,d;
	scanf("%d%d%d%d",&n,&m,&k,&d);
	C[0][0] = 1;
	for(int i = 1;i <= 100; ++ i)
	{
		C[i][0] = 1;
		pw[i][0] = 1;
		for(int j = 1;j <= 100; ++ j)
			pw[i][j] = pw[i][j - 1] * 1ll * i % d,
			C[i][j] = (C[i - 1][j] + C[i - 1][j - 1]) % d;
	}
	int cur = 1,nxt = 0;
	dp[0][0][0] = 1;
	for(int i = 1;i <= k; ++ i)
	{
		cur ^= 1; nxt ^= 1; memset(dp[nxt],0,sizeof(dp[nxt]));
		for(int j = 0;j <= n; ++ j)
			for(int l = 0;l <= m; ++ l)
			{
				int tm = pw[k - i + 1][l] * 1ll * pw[i][m - l] % d;
				for(int p = 0,x = dp[cur][j][l];j + p <= n; ++ p,x = x * 1ll * tm % d)
					dp[nxt][j + p][l] = (dp[nxt][j + p][l] + x * 1ll * C[n - j][p]) % d;
			}
		cur ^= 1; nxt ^= 1; memset(dp[nxt],0,sizeof(dp[nxt]));
		for(int j = 0;j <= n; ++ j)
			for(int l = 0;l <= m; ++ l)
			{
				int tm = pw[k - i + 1][j] * 1ll * pw[i][n - j] % d;
				for(int p = 0,x = dp[cur][j][l];l + p <= m; ++ p,x = x * 1ll * tm % d)
					dp[nxt][j][l + p] = (dp[nxt][j][l + p] + x * 1ll * C[m - l][p]) % d;
			}
		cur ^= 1; nxt ^= 1; memset(dp[nxt],0,sizeof(dp[nxt]));
		for(int j = 0;j <= n; ++ j)
			for(int l = 0;l <= m; ++ l)
			{
				int tm = pw[k - i][l] * 1ll * pw[i][m - l] % d * (d - 1) % d;
				for(int p = 0,x = dp[cur][j][l];j + p <= n; ++ p,x = x * 1ll * tm % d)
					dp[nxt][j + p][l] = (dp[nxt][j + p][l] + x * 1ll * C[n - j][p]) % d;
			}
		cur ^= 1; nxt ^= 1; memset(dp[nxt],0,sizeof(dp[nxt]));
		for(int j = 0;j <= n; ++ j)
			for(int l = 0;l <= m; ++ l)
			{
				int tm = (d - 1) * 1ll * pw[k - i][j] % d * pw[i][n - j] % d;
				for(int p = 0,x = dp[cur][j][l];l + p <= m; ++ p,x = x * 1ll * tm % d)
					dp[nxt][j][l + p] = (dp[nxt][j][l + p] + x * 1ll * C[m - l][p]) % d;
			}
	}
	printf("%d\n",dp[nxt][n][m]);
}