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<cstdio>
const int N=107;
int n,m,k,P,f[N][N][N],C[N][N],pw[N][N];
void inc(int&a,int b){a+=b-P,a+=a>>31&P;}
int sub(int a,int b){return a-=b,a+(a>>31&P);}
int mul(int a,int b){return 1ll*a*b%P;}
int main()
{
    scanf("%d%d%d%d",&n,&m,&k,&P),f[0][0][0]=1;
    for(int i=0;i<=100;++i) for(int j=C[i][0]=1;j<=i;++j) inc(C[i][j]=C[i-1][j],C[i-1][j-1]);
    for(int i=0;i<=100;++i) for(int j=pw[i][0]=1;j<=100;++j) pw[i][j]=mul(pw[i][j-1],i);
    for(int h=1;h<=k;++h)
    {
	for(int i=0;i<=n;++i)
	    for(int j=0;j<=m;++j)
		for(int t=mul(pw[k-h+1][j],sub(pw[h][m-j],pw[h-1][m-j])),s=1,l=i;l<=n;++l)
		    inc(f[h][l][j],mul(mul(s,C[n-i][l-i]),f[h-1][i][j])),s=mul(s,t);
	for(int i=0;i<=n;++i)
	    for(int j=m;~j;--j)
		for(int t=mul(pw[h][n-i],sub(pw[k-h+1][i],pw[k-h][i])),s=1,l=j+1;l<=m;++l)
		    s=mul(s,t),inc(f[h][i][l],mul(mul(s,C[m-j][l-j]),f[h][i][j]));
    }
    printf("%d",f[k][n][m]);
}