#include<stdio.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<string.h>
using namespace std;

typedef long long LL;
typedef vector<int> VI;

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define EACH(i,c) for(__typeof((c).begin()) i=(c).begin(),i##_end=(c).end();i!=i##_end;++i)
#define eprintf(...) fprintf(stderr, __VA_ARGS__)

template<class T> inline void amin(T &x, const T &y) { if (y<x) x=y; }
template<class T> inline void amax(T &x, const T &y) { if (x<y) x=y; }
template<class Iter> void rprintf(const char *fmt, Iter begin, Iter end) {
    for (bool sp=0; begin!=end; ++begin) { if (sp) putchar(' '); else sp = true; printf(fmt, *begin); }
    putchar('\n');
}
namespace MOD_INT_GLOBAL {
    unsigned uMod;

    struct Mint {
	unsigned x;

	Mint() : x(0) {}
	Mint(const Mint &y) : x(y.x) {}
	Mint(unsigned y) { if (uMod <= y) y %= uMod; x = y; }
	Mint(int y) { if (y < 0 || (long long)uMod <= y) y %= uMod; if (y < 0) y += uMod; x = y; }
	Mint(unsigned long long y) { if (uMod <= y) y %= uMod; x = y; }
	Mint(long long y) { if (y < 0 || uMod <= y) y %= uMod; if (y < 0) y += uMod; x = y; }

	Mint& operator+=(const Mint &y) { if ((x += y.x) >= uMod) x -= uMod; return *this; }
	Mint& operator-=(const Mint &y) { if ((x += uMod - y.x) >= uMod) x -= uMod; return *this; }
	Mint& operator*=(const Mint &y) { x = (unsigned long long)x * y.x % uMod; return *this; }
	Mint& operator/=(const Mint &y) { x = (unsigned long long)x * y.inv().x % uMod; return *this; }
	Mint operator-() const { return x? uMod - x: 0; }

	int geti() const { return x; }
    
	Mint inv() const {
	    unsigned a = uMod, b = x; int u = 0, v = 1;
	    while (b) {
		int t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	    }
	    if (u < 0) u += uMod;
	    return Mint(u);
	}

	Mint pow(long long y) const {
	    Mint b = *this, r = 1;
	    if (y < 0) { b = b.inv(); y = -y; }
	    for (; y; y>>=1) {
		if (y&1) r *= b;
		b *= b;
	    }
	    return r;
	}

	friend Mint operator+(Mint x, const Mint &y) { return x += y; }
	friend Mint operator-(Mint x, const Mint &y) { return x -= y; }
	friend Mint operator*(Mint x, const Mint &y) { return x *= y; }
	friend Mint operator/(Mint x, const Mint &y) { return x /= y; }
	friend bool operator<(const Mint x, const Mint y) { return x.x < y.x; }
	friend bool operator==(const Mint x, const Mint y) { return x.x == y.x; }
	friend bool operator!=(const Mint x, const Mint y) { return x.x != y.x; }
    };
}; // namespace MOD_INT_GLOBAL

using namespace MOD_INT_GLOBAL;

const int MAX = 1000;
Mint nCk[MAX][MAX];

void init() {
    nCk[0][0] = 1;
    for (int n=1; n<MAX; n++) {
	nCk[n][0] = 1;
	for (int k=1; k<MAX; k++) {
	    nCk[n][k] = nCk[n-1][k-1] + nCk[n-1][k];
	}
    }
}

int N;
int K;
LL mod;

Mint dp[311][311];
Mint dp2[311][311];

void MAIN() {
    scanf("%d%d%lld", &N, &K, &mod);
    uMod = mod;
    init();

    dp[0][0] = 1;
    dp2[0][0] = 1;
    REP (k, K+1) {
	REP (n, N+1) {
	    if (k) {
		dp[k][n] += dp[k-1][n];

		if (n) {
		    dp[k][n] += dp2[k-1][n-1];
		}
	    }

	    for (int a=1; a<=n; a++) {
		dp2[k][n] += dp[k][a] * dp2[k][n-a] * nCk[n-1][a-1];
	    }
	    if (n == 0) {
		dp2[k][0] = 1;
	    }
	}
    }

    Mint ans = dp2[K][N];
    printf("%d\n", ans.geti());
}

int main() {
    int TC = 1;
//    scanf("%d", &TC);
    REP (tc, TC) MAIN();
    return 0;
}



Measured memory_bytes: 4864