/*
I've been down this road once or twice before
through the open door
i come falling through it
there's a sign post up ahead
like a watershed
and it opens my eyes
ways, for me to begin
to be born again
and knowing for the first time
ways, all so differently
shine for me to see
the better man that I am

I've been places in my head
behind me worse than what's ahead
and on my path just like a dream
takes me from the inbetween
from out of nowhere you came strong as stone
and now I'll never have to be alone
what it is I know

you have always been my safe home
I walk, I run, I burn out into you
you have always been my safe home
my whole world has moved on

i know what i am and I'll always be
your reality, is better than I could dream
all my fears turn from black to white
and i'd stand and fight
the whole world for you
faith, and destiny
I never did believe
my only god is love and
faith, what I see in you
and I can hold it true
like a weight in my hand.
*/

#pragma GCC optimize("O3")
#define _CRT_SECURE_NO_WARNINGS
#include <fstream>
#include <iostream>
#include <string>
#include <complex>
#include <math.h>
#include <set>
#include <vector>
#include <map>
#include <queue>
#include <stdio.h>
#include <stack>
#include <algorithm>
#include <list>
#include <ctime>

#include <memory.h>
#include <assert.h>

#define y0 sdkfaslhagaklsldk

#define y1 aasdfasdfasdf
#define yn askfhwqriuperikldjk
#define j1 assdgsdgasghsf
#define tm sdfjahlfasfh
#define lr asgasgash
#define norm asdfasdgasdgsd
#define have adsgagshdshfhds
#define ends asdgahhfdsfshdshfd

#define eps 1e-8
#define M_PI 3.141592653589793
#define bsize 512

#define ldouble long double
using namespace std;

#define bs 1000000007

const int N = 600031;

/*int n,k,m;
vector<int> v;
int res;

void naive_solver(vector<int>v){
	//cout<<v.size()<<endl;
	//for (int i=0;i<v.size();i++){
	//	cout<<v[i]<<" ";
	//}
	//cout<<endl;

	if (v.size()==n){
		++res;
		return;
	}
	for (int i=0;i<v.size();i++){
		for (int ad=v[i]+1;ad<=k;ad++){
			//cout<<i<<" "<<" "<<v.size()<<" "<<ad<<endl;
			vector<int> t;
			for (int j=0;j<i;j++)
				t.push_back(v[j]);
			t.push_back(ad);
			for (int j=i;j<v.size();j++)
				t.push_back(v[j]);
			naive_solver(t);
		}
	}
	for (int i=1;i<=k;i++){
		v.push_back(i);
		naive_solver(v);
		v.pop_back();
	}
}
*/

int n,m,k;
long long C[331][331];

long long solve(int len,int rmost){
	if (len==0)
		return 1;
	long long ret=0;
	for (int ps=1;ps<=len;ps++){
		for (int ad=1;ad<=k;ad++){
			if (ad<=rmost)
				continue;
			long long here=solve(len-ps,rmost)*solve(ps-1,ad)%m*C[len-1][ps-1]%m;
			ret=ret+here;
			ret%=m;
		}
	}
	return ret;
}

long long dp[331][331],sum_dp[331][331];

int main(){
//	freopen("apache.in","r",stdin);
//	freopen("apache.out","w",stdout);
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	ios_base::sync_with_stdio(0);
//	cin.tie(0);

	cin>>n>>k>>m;

	for (int i=0;i<=n;i++){
		for (int j=0;j<=n;j++){
			if(i==j||j==0)
				C[i][j]=1%m;
			else
				C[i][j]=(C[i-1][j]+C[i-1][j-1])%m;
		}
	}

	for (int i=0;i<=k;i++){
		dp[0][i]=1%m;
	}

	for (int len=0;len<=n;len++){
		for (int rmost=0;rmost<=k;rmost++){
			for (int cut=1;cut<=n;cut++){
				long long ways=dp[len-cut][rmost]*C[len-1][cut-1]%m;
				ways*=sum_dp[cut-1][rmost+1];
				ways%=m;
				dp[len][rmost]+=ways;
				dp[len][rmost]%=m;
			}
		}
		for (int rmost=k;rmost>=0;--rmost){
			sum_dp[len][rmost]=dp[len][rmost]+sum_dp[len][rmost+1];
			sum_dp[len][rmost]%=m;
		}
	}

	cout<<dp[n][0]<<endl;
//	cout<<solve(n,0)<<endl;

//	cin.get(); cin.get();
	return 0;
}


Measured memory_bytes: 2560