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

int f[310][310],n,k,mod,g[310][310],sum[310][310],C[310][310];

int main()
{
	scanf("%d%d%d",&n,&k,&mod);
	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])%mod;
	}
	g[0][k+1]=sum[0][k+1]=1;
	for (int i=k; i; i--)
	{
		for (int j=1; j<=n; j++)
		{
			f[j][i]=0;
			for (int l=i; l<=k+1; l++) 
				f[j][i]=(f[j][i]+g[j-1][l]>=mod?f[j][i]+g[j-1][l]-mod:f[j][i]+g[j-1][l]);
			for (int l=0; l<=n-j; l++)
				g[j+l][i]=(g[j+l][i]+1ll*f[j][i]*sum[l][i+1]%mod*C[j+l][l])%mod;
		}
		for (int j=0; j<=n; j++) sum[j][i]=(sum[j][i+1]+g[j][i])%mod;
	}
	printf("%d\n",sum[n][1]);
	return 0;
}