Problem: For each of the K^{NM} ways to write an integer between 1 and K (inclusive) in every square in a square grid with N rows and M columns, find the value defined below, then compute the sum of all those K^{NM} values, modulo D.

* For each of the NM squares, find the minimum among the N+M-1 integers written in the square's row or the square's column. The value defined for the grid is the product of all these NM values.

Constraints

* 1 \leq N,M,K \leq 100
* 10^8 \leq D \leq 10^9
* N,M,K, and D are integers.
* D is prime.

Input

Input is given from Standard Input in the following format:


N M K D


Output

Print the sum of the K^{NM} values, modulo D.

Examples

Input

2 2 2 998244353


Output

35


Input

2 3 4 998244353


Output

127090


Input

31 41 59 998244353


Output

827794103

Solution (in CPP):

Solution:
#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
#define N 123
inline int read(){
	int x=0,f=1;
	char c=getchar();
	while(c<'0'||c>'9'){
		if(c=='-')f=-1;
		c=getchar();
	}
	while(c>='0'&&c<='9'){
		x=(x<<1)+(x<<3)+c-'0';
		c=getchar();
	}
	return x*f;
}
const int n=read(),m=read(),V=read(),mod=read();
int C[N][N],dp[2][N][N],pw[N][N*N];
void init(int n){
	C[0][0]=1;
	for(int i=1;i<=n;++i){
		C[i][0]=1;
		for(int j=1;j<=i;++j){
			C[i][j]=(C[i-1][j]+C[i-1][j-1])%mod;
		}
	}
	for(int i=0;i<=n;++i){
		pw[i][0]=1;
		for(int j=1;j<=n*n;++j){
			pw[i][j]=1LL*pw[i][j-1]*i%mod;
		}
	}
}
int main(){
	init(max(max(n,m),V));
	dp[0][0][0]=1;
	int u=0;
	for(int k=1;k<=V;++k){
		u^=1;
		memset(dp[u],0,sizeof(dp[u]));
		for(int i=0;i<=n;++i){
			for(int j=0;j<=m;++j){
				int now=dp[u^1][i][j];
				if(!now)continue;
				for(int a=0;i+a<=n;++a){
					dp[u][i+a][j]=(dp[u][i+a][j]+1LL*now*C[n-i][a]%mod*pw[k][a*(m-j)]%mod*pw[V-k+1][a*j])%mod;
				}
			}
		}
		u^=1;
		memset(dp[u],0,sizeof(dp[u]));
		for(int i=0;i<=n;++i){
			for(int j=0;j<=m;++j){
				int now=dp[u^1][i][j];
				if(!now)continue;
				for(int b=0;j+b<=m;++b){
					dp[u][i][j+b]=(dp[u][i][j+b]+1LL*now*C[m-j][b]%mod*pw[k][b*(n-i)]%mod*pw[V-k+1][b*i])%mod;
				}
			}
		}
		u^=1;
		memset(dp[u],0,sizeof(dp[u]));
		for(int i=0;i<=n;++i){
			for(int j=0;j<=m;++j){
				int now=dp[u^1][i][j];
				if(!now)continue;
				for(int a=0;i+a<=n;++a){
					dp[u][i+a][j]=(dp[u][i+a][j]+1LL*now*C[n-i][a]%mod*pw[k][a*(m-j)]%mod*pw[V-k][a*j]*(a&1?-1:1))%mod;
				}
			}
		}
		u^=1;
		memset(dp[u],0,sizeof(dp[u]));
		for(int i=0;i<=n;++i){
			for(int j=0;j<=m;++j){
				int now=dp[u^1][i][j];
				if(!now)continue;
				for(int b=0;j+b<=m;++b){
					dp[u][i][j+b]=(dp[u][i][j+b]+1LL*now*C[m-j][b]%mod*pw[k][b*(n-i)]%mod*pw[V-k][b*i]*(b&1?-1:1))%mod;
				}
			}
		}
	}
	printf("%d\n",(dp[u][n][m]+mod)%mod);
	return 0;
}