#include<stdio.h>
typedef long long ll;
ll dp[311][311][311];
int main()
{
	int num, gen;
	ll mod;
	scanf("%d%d%lld", &num, &gen, &mod);
	dp[0][0][0] = 1;
	for (int i = 0; i < gen; i++)
	{
		for (int j = 0; j <= num; j++)dp[i + 1][j][j] = dp[i][j][0];
		for (int j = 0; j <= num; j++)for (int k = j - 1; k >= 0; k--)dp[i + 1][j][k] = (dp[i + 1][j][k + 1] + dp[i + 1][j - 1][k] * (k + 1)) % mod;
	}
	printf("%lld\n", dp[gen][num][0]);
}
