#include<bits/stdc++.h>
#define ll long long
#define ull unsigned ll
#define uint unsigned
#define pii pair<int,int>
#define pll pair<ll,ll>
#define PB push_back
#define fi first
#define se second
#define For(i,j,k) for (int i=(int)(j);i<=(int)(k);i++)
#define Rep(i,j,k) for (int i=(int)(j);i>=(int)(k);i--)
#define CLR(a,v) memset(a,v,sizeof(a));
#define CPY(a,b) memcpy(a,b,sizeof(a));
using namespace std;
const int N=105;
int n,m,K,mo;
int C[N][N],f[N][N],g[N][N];
int P[N][N*N],IP[N][N*N];
int power(int x,int y){
	int s=1;
	for (;y;y/=2,x=1ll*x*x%mo)
		if (y&1) s=1ll*s*x%mo;
	return s; 
}
int main(){
	scanf("%d%d%d%d",&n,&m,&K,&mo);
	For(i,0,N-1) C[i][0]=1;
	For(i,0,K) P[i][0]=IP[i][0]=1;
	For(i,0,K) IP[i][1]=power(i,mo-2);
	For(i,0,K) For(j,1,n*m) P[i][j]=1ll*P[i][j-1]*i%mo;
	For(i,0,K) For(j,1,n*m) IP[i][j]=1ll*IP[i][j-1]*IP[i][1]%mo;
	For(i,1,N-1) For(j,1,i)
		C[i][j]=(C[i-1][j-1]+C[i-1][j])%mo;
	f[0][0]=1;
	For(i,1,K){
		For(j,0,n) For(k,0,m) f[j][k]=1ll*f[j][k]*P[i][(n-j)*(m-k)]%mo*IP[K-i+1][j*k]%mo;
		memset(g,0,sizeof(g));
		For(j,0,n) For(k,0,m) For(jj,0,n-j)
			g[j+jj][k]=(g[j+jj][k]+1ll*f[j][k]*C[jj+j][j])%mo;
		memset(f,0,sizeof(f));
		For(j,0,n) For(k,0,m) For(kk,0,m-k)
			f[j][k+kk]=(f[j][k+kk]+1ll*g[j][k]*C[kk+k][k])%mo;
		For(j,0,n) For(k,0,m) f[j][k]=1ll*f[j][k]*P[K-i+1][j*k]%mo;
		if (K!=i){
			For(j,0,n) For(k,0,m) f[j][k]=1ll*f[j][k]*IP[K-i][j*k]%mo;
			memset(g,0,sizeof(g));
			For(j,0,n) For(k,0,m) For(jj,0,n-j)
				g[j+jj][k]=(g[j+jj][k]+1ll*f[j][k]*(jj&1?mo-C[jj+j][j]:C[jj+j][j]))%mo;
			memset(f,0,sizeof(f));
			For(j,0,n) For(k,0,m) For(kk,0,m-k)
				f[j][k+kk]=(f[j][k+kk]+1ll*g[j][k]*(kk&1?mo-C[kk+k][k]:C[kk+k][k]))%mo;
			For(j,0,n) For(k,0,m) f[j][k]=1ll*f[j][k]*IP[i][(n-j)*(m-k)]%mo*P[K-i][j*k]%mo;
		}
	}
	printf("%d",f[n][m]);
}