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:
/****************************************************************
*	Author: huhao
*	Email: 826538400@qq.com
*	Create time: 2020-02-15 17:45:39
****************************************************************/
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<algorithm>
#define fr(i,a,b) for(int i=(a),end_##i=(b);i<=end_##i;i++)
#define fd(i,a,b) for(int i=(a),end_##i=(b);i>=end_##i;i--)
int read()
{
	int r=0,t=1,c=getchar();
	while(c<'0'||c>'9')
	{
		t=c=='-'?-1:1;
		c=getchar();
	}
	while(c>='0'&&c<='9')
	{
		r=(r<<3)+(r<<1)+(c^48);
		c=getchar();
	}
	return r*t;
}
#define i64 long long
const int N=110;
i64 f[N][N],F[N][N],n,m,k,mod,C[N][N],p[N][N*N],P[N][N][N];
i64 &Add(i64 &a,i64 b){ return a=(a+b)%mod; }
i64 power(i64 a,i64 b,i64 p)
{
	i64 r=1;
	for(;b;b>>=1,a=a*a%p) if(b&1) r=r*a%p;
	return r;
}
int main()
{
	n=read(); m=read(); k=read(); mod=read();
	fr(i,0,100) C[i][0]=C[i][i]=1;
	fr(i,1,100) fr(j,1,i-1) C[i][j]=(C[i-1][j]+C[i-1][j-1])%mod;
	fr(i,0,100) fr(j,0,10000) p[i][j]=power(i,j,mod);
	f[0][0]=1;
	fr(l,1,k) fr(i,0,std::max(n,m)) fr(j,0,std::max(n,m)) P[l][i][j]=power(p[l][i]+mod-p[l-1][i],j,mod);
	fr(l,1,k)
	{
		fr(i,0,n) fr(j,0,m) F[i][j]=0;
		fr(i,0,n) fr(j,0,m) fr(o,i,n)
			Add(F[o][j],f[i][j]*C[o][i]%mod*P[l][m-j][o-i]%mod*p[k-l+1][j*(o-i)]);
//		fr(i,0,n) fr(j,0,m) printf("%d%c",int(F[i][j]),j==m?'\n':' '); putchar(10);
		fr(i,0,n) fr(j,0,m) f[i][j]=0;
		fr(i,0,n) fr(j,0,m) fr(o,j,m)
			Add(f[i][o],F[i][j]*C[o][j]%mod*P[k-l+1][i][o-j]%mod*p[l][(n-i)*(o-j)]);
//		fr(i,0,n) fr(j,0,m) printf("%d%c",int(f[i][j]),j==m?'\n':' '); putchar(10);
	}
	printf("%d\n",int(f[n][m]));
	return 0;
}