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<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=105;
ll f[N][N][N],mo;
int n,m,k;
ll C[N][N];
ll pw[N][N*N];
void move(ll &a,ll b){
	a=(a+b)%mo;
}
int main(){
	cin>>n>>m>>k>>mo;
	for (int i=0;i<=100;i++){
		C[i][0]=C[i][i]=1;
		for (int j=1;j<i;j++)C[i][j]=(C[i-1][j]+C[i-1][j-1])%mo;
		pw[i][0]=1;
		for (int j=1;j<=10000;j++)
			pw[i][j]=pw[i][j-1]*i%mo;
	}
	f[0][0][0]=1;
	for (int h=1;h<=k;h++){
		for (int i=0;i<=n;i++)
		for (int j=0;j<=m;j++){
			ll p0=(pw[h][m-j]-pw[h-1][m-j]+mo)%mo*pw[k-h+1][j]%mo,p1=1;
			for (int x=i;x<=n;x++){
				move(f[h][x][j],f[h-1][i][j]*C[n-i][x-i]%mo*p1);
				p1=p1*p0%mo;
			}
		}
		for (int i=0;i<=n;i++)
		for (int j=m;j>=0;j--){
			ll p0=(pw[k-h+1][i]-pw[k-h][i]+mo)%mo*pw[h][n-i]%mo,p1=1;
			for (int x=j+1;x<=m;x++){
				p1=p1*p0%mo;
				move(f[h][i][x],f[h][i][j]*C[m-j][x-j]%mo*p1);
			}
		}
	}
	cout<<f[k][n][m]<<endl;
}