#include <bits/stdc++.h>
typedef long long ll;
const int N=105;
int n,m,K,d,f[N][N][N],g[N][N][N],mu,C[N][N],p[N][N*N],p2[N][N][N];
int main(){
scanf("%d%d%d%d",&n,&m,&K,&mu);
C[0][0]=1;
for (int i=1;i<=std::max(n,m);i++){
C[i][0]=1;
for (int j=1;j<=i;j++)
C[i][j]=(C[i-1][j-1]+C[i-1][j])%mu;
}
for (int i=1;i<=K;i++){
for (int j=0,now=1;j<=n*m;j++,now=(ll)now*i%mu)
p[i][j]=now;
}
for (int i=1;i<=K;i++){
for (int j=0;j<=n || j<=m;j++){
int ww=(p[i][j]-p[i-1][j]+mu)%mu;
for (int k=0,now=1;k<=n || k<=m;k++,now=(ll)now*ww%mu)
p2[i][j][k]=now;
}
}
g[0][0][0]=1;
for (int k=1;k<=K;k++){
//向下
for (int i=0;i<=n;i++)
for (int j=0;j<=m;j++)
for (int len=0;i+len<=n;len++){
int t=g[k-1][i][j];
f[k][i+len][j]=(f[k][i+len][j]+(ll)t*C[i+len][len]%mu*p[K-k+1][j*len]%mu*p2[k][m-j][len])%mu;
}
//向右
for (int i=0;i<=n;i++)
for (int j=0;j<=m;j++)
for (int len=0;j+len<=m;len++){
int t=f[k][i][j];
g[k][i][j+len]=(g[k][i][j+len]+(ll)t*C[j+len][len]%mu*p[k][(n-i)*len]%mu*p2[K-k+1][i][len])%mu;
}
}
printf("%d
",g[K][n][m]);
}