#include <bits/stdc++.h>
using namespace std;
const int N=305;
int n,mo,k,c[N][N],f[N][N],w[N][N];
int main(){
    cin>>n>>k>>mo;
    for (int i=0; i<=n; ++i){
	c[i][0]=1;
	for (int j=1; j<=i; ++j)
	    c[i][j]=(c[i-1][j-1]+c[i-1][j])%mo;
    }
    for (int i=k; i>=0; --i){
	f[i][0]=1;
	for (int j=1; j<=n; ++j)
	    for (int t=0; t<j; ++t)
		(f[i][j]+=1ll*w[i+1][j-t-1]*f[i][t]%mo*c[j-1][t]%mo)%=mo;
	for (int j=0; j<=n; ++j)
	    w[i][j]=(w[i+1][j]+f[i][j])%mo;
    }
    cout<<f[0][n];
    return 0;
}
