#include<bits/stdc++.h>

using namespace std;

typedef long long LL;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
mt19937 mrand(random_device{}());

const int N = 405;

int n , m , k , mod;
int pw[N][N * N] , binom[N][N] , dp[2][N][N] , trans[N][N];

template <typename T> inline void chkmin(T &x , T y) { x = min(x , y); }
template <typename T> inline void chkmax(T &x , T y) { x = max(x , y); }
template <typename T> inline void read(T &x) {
   	T f = 1; x = 0;
   	char c = getchar();
  	for (; !isdigit(c); c = getchar()) if (c == '-') f = -f;
    for (; isdigit(c); c = getchar()) x = (x << 3) + (x << 1) + c - '0';
    x *= f;
}

inline void inc(int &x , int y) {
	x = x + y < mod ? x + y : x + y - mod;
}
inline void dec(int &x , int y) {
	x = x - y >= 0 ? x - y : x - y + mod;
}
inline void init(int limit) { 
	for (int i = 0; i <= limit; ++i) {
		pw[i][0] = 1LL;
		for (int j = 1; j <= limit * limit; ++j)
			pw[i][j] = 1LL * pw[i][j - 1] * i % mod;
	}
	binom[0][0] = 1;
	for (int i = 1; i <= limit; ++i) {
		binom[i][0] = 1;
		for (int j = 1; j <= i; ++j)
			binom[i][j] = (binom[i - 1][j] + binom[i - 1][j - 1]) % mod;
	}
}

int main() {
     
     read(n); read(m); read(k); read(mod);
     init(205);
     int cur = 0; dp[0][0][0] = 1;
     for (int now = 1; now <= k; ++now) {
     	  cur ^= 1; memset(dp[cur] , 0 , sizeof(dp[cur]));
     	  for (int j = 0; j <= m; ++j) 
     	  for (int i = 0; i <= n; ++i)
     	      trans[j][i] = 1LL * pw[now][i * (m - j)] * pw[k - now + 1][i * j] % mod;
		  for (int i = 0; i <= n; ++i)	  
		  for (int j = 0; j <= m; ++j) {
		  	  int x = dp[cur ^ 1][i][j]; if (!x) continue;
		  	  for (int add = 0; i + add <= n; ++add)
		  	  		inc(dp[cur][i + add][j] , 1LL * binom[i + add][i] * x % mod * trans[j][add] % mod);
		  }		
		  cur ^= 1; memset(dp[cur] , 0 , sizeof(dp[cur]));
		  for (int i = 0; i <= n; ++i)
		  for (int j = 0; j <= m; ++j)
		  		trans[i][j] = 1LL * pw[now][j * (n - i)] * pw[k - now + 1][j * i] % mod;
		  for (int i = 0; i <= n; ++i)
		  for (int j = 0; j <= m; ++j) {
		  	   int x = dp[cur ^ 1][i][j]; if (!x) continue;
		  	   for (int add = 0; j + add <= m; ++add)
		  	   		inc(dp[cur][i][j + add] , 1LL * binom[j + add][j] * x % mod * trans[i][add] % mod);
		  }
		  cur ^= 1; memset(dp[cur] , 0 , sizeof(dp[cur]));
		  for (int j = 0; j <= m; ++j)
		  for (int i = 0; i <= n; ++i)
		  		trans[j][i] = 1LL * pw[now][i * (m - j)] * pw[k - now][i * j] % mod;
		  for (int i = 0; i <= n; ++i)
		  for (int j = 0; j <= m; ++j) {
		  	  int x = dp[cur ^ 1][i][j]; if (!x) continue;
		  	  for (int add = 0; i + add <= n; ++add) {
		  	  	   int val = 1LL * x * binom[i + add][i] % mod * trans[j][add] % mod;
				   if (add & 1) dec(dp[cur][i + add][j] , val); else inc(dp[cur][i + add][j] , val);		
			  }
		  }
		  cur ^= 1; memset(dp[cur] , 0 , sizeof(dp[cur]));
		  for (int i = 0; i <= n; ++i)
		  for (int j = 0; j <= m; ++j)
		  	  trans[i][j] = 1LL * pw[now][j * (n - i)] * pw[k - now][i * j] % mod;
		  for (int i = 0; i <= n; ++i)
		  for (int j = 0; j <= m; ++j) {
		  	   int x = dp[cur ^ 1][i][j]; if (!x) continue;
		  	   for (int add = 0; j + add <= m; ++add) {
		  	   	   int val = 1LL * x * binom[j + add][j] % mod * trans[i][add] % mod;
				   if (add & 1) dec(dp[cur][i][j + add] , val); else inc(dp[cur][i][j + add] , val);	   
		       }
		  }
	 }
	 printf("%d\n" , dp[cur][n][m]);
     return 0;
}


Measured memory_bytes: 40148