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>
#define int long long
using std::cin;
using std::cout;

const int N = 105;

int f[N][N][N], g[N][N], p[N][N], mo;

signed main() {
	int n, m, k; 
	cin >> n >> m >> k >> mo;
	f[0][0][0] = 1;
	for (int i = 0; i <= 100; ++ i) {
		g[i][0] = 1;
		for (int j = 1; j <= i; ++ j) {
			g[i][j] = (g[i - 1][j] + g[i - 1][j - 1]) % mo;
		}
	}
	for (int i = 0; i <= 100; ++ i) {
		p[i][0] = 1;
		for (int j = 1; j <= 100; ++ j)  {
			p[i][j] = p[i][j - 1] * i % mo;
		}
	}
	for (int h = 1; h <= k; ++ h) {
		for (int i = 0; i <= n; ++ i) {
			for (int j = 0; j <= m; ++ j) {
				for (int t = (p[k - h + 1][j] * ((p[h][m - j] - p[h - 1][m - j] + mo) % mo)) % mo, s = 1, l = i; l <= n; ++ l) {
					(f[h][l][j] += (s * g[n - i][l - i] % mo * f[h - 1][i][j] % mo)) %= mo;
					(s *= t) %= mo;
				}
			}
		}
		for (int i = 0; i <= n; ++ i) {
			for (int j = m; ~j; -- j) {
				for (int t = (p[h][n - i] * ((p[k - h + 1][i] - p[k - h][i] + mo) % mo)) % mo, s = 1, l = j + 1; l <= m; ++ l) {
					(s *= t) %= mo;
					(f[h][i][l] += (s * g[m - j][l - j] % mo * f[h][i][j] % mo)) %= mo;
				}
			}
		}
	}
	cout << f[k][n][m] << '\n';
	return 0;
}