#include <bits/stdc++.h>
using namespace std;

const int N = 333;

int f[N][N][N], n, K, MOD;

int main(void) {
  scanf("%d%d%d", &n, &K, &MOD);
  f[0][1][0] = 1;
  for(int i = 0; i <= n; i++) {
    for(int j = 1; j <= K; j++) {
      for(int k = i; ~k; k--) {
	if(k) {
	  (f[i][j][k - 1] += f[i][j][k]) %= MOD;
	} else {
	  (f[i][j + 1][i] += f[i][j][k]) %= MOD;
	}
	(f[i + 1][j][k] += 1LL * (k + 1) * f[i][j][k] % MOD) %= MOD;
      }
    }
  }
  cout << f[n][K + 1][n] << endl;
}
