Ember and Storm play a game. First, Ember picks a labelled tree T of n vertices, such that the degree of every vertex is at most d. Then, Storm picks two distinct vertices u and v in this tree and writes down the labels of the vertices in the path from u to v in a sequence a1, a2... ak. Finally, Ember picks any index i (1 ≤ i < k) in the array. Now he performs one of the following two operations exactly once:  flip the subrange [i + 1, k] and add ai to it. After this, the sequence becomes a1, ... ai, ak + ai, ak - 1 + ai, ... ai + 1 + ai  negate the subrange [i + 1, k] and add ai to it. i.e., the array becomes a1, ... ai,  - ai + 1 + ai,  - ai + 2 + ai, ... - ak + ai Ember wins if the array is monotonically increasing or decreasing after this. Otherwise Storm wins.The game can be described by the tuple (T, u, v, i, op) where op is «flip» or «negate» depending on the action Ember chose in the last turn. Find the number of tuples that can occur if Ember and Storm play optimally. When they play optimally, if there are multiple moves by which they are guaranteed to win, then they may play any of the winning moves. Otherwise, if someone loses no matter what they play, then they may play any of the possible moves.Report the answer modulo m.

The input consists of a single line containing three integers n, d and m (2 ≤ n ≤ 200, 1 ≤ d < n, 1 ≤ m ≤ 2·109).

Print a single number  — the number of possible tuples if Ember and Storm play as described, modulo m.

NoteIn the first sample case, there is only one possible tree. There are two possible paths, 1 to 2 and 2 to 1. For both paths, i can only be 1, and op can take both possibilities. Therefore, the answer is 4.In the second sample, there are no possible trees.In the third sample, there are three possible trees.

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

const int MAXN = 205;

int N, D, M;
int dp[MAXN][MAXN][MAXN];
int pref[MAXN][MAXN];
int choose[MAXN][MAXN];
int pre[MAXN][MAXN];

void load() {
	scanf("%d%d%d", &N, &D, &M);
}

inline int add(int x, int y) {
	return x >= M - y ? x - (M - y) : x + y;
}

inline int mul(int x, int y) {
	return (long long)x * y % M;
}

int solve() {
	if (D == 1)
		return N == 2 ? 4 % M : 0;

	choose[0][0] = 1;
	for (int i = 1; i <= N; i++) {
		choose[i][0] = 1;
		for (int j = 1; j <= i; j++)
			choose[i][j] = add(choose[i - 1][j - 1], choose[i - 1][j]);
	}

	pref[1][0] = 1;
	for (int i = 1; i <= N; i++) {
		dp[i][0][0] = 1;
		for (int j = 1; j <= min(D, i - 1); j++)
			for (int k = 1; k < i; k++)
				for (int l = 1; l <= k; l++)
					dp[i][j][k] = add(dp[i][j][k], mul(dp[i][j - 1][k - l], pre[k][l]));
		for (int j = 1; j <= D; j++)
			pref[i][j] = add(pref[i][j - 1], dp[i][j][i - 1]);
		for (int k = i; k < N; k++)
			pre[k][i] = mul(choose[k - 1][i - 1], pref[i][D - 1]);
	}

	int sol = 0;
	for (int i = 1; i <= N; i++)
		for (int j = 2; j < D; j++)
			for (int k = 1; j + k <= D; k++)
				sol = add(sol, mul(dp[i][j][i - 1], dp[N - i + 1][k][N - i]));

	for (int i = 1; i <= D; i++)
		sol = add(sol, dp[N][i][N - 1]);

	for (int i = 2; i <= D; i++)
		sol = add(sol, dp[N][i][N - 1]);

	return mul(sol, mul(2, mul(N, N - 1)));
}

int main() {
	load();
	printf("%d\n", solve());
	return 0;
}

#include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <list>
#include <cassert>
#include <ctime>
#include <climits>
using namespace std;

#define PB push_back
#define MP make_pair
#define SZ(v) ((int)(v).size())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define FORE(i,a,b) for(int i=(a);i<=(b);++i)
#define REPE(i,n) FORE(i,0,n)
#define FORSZ(i,a,v) FOR(i,a,SZ(v))
#define REPSZ(i,v) REP(i,SZ(v))
typedef long long ll;
typedef unsigned long long ull;
ll gcd(ll a,ll b) { return b==0?a:gcd(b,a%b); }

const int MAXN = 200;

int n, maxdeg, MOD;

int C[MAXN + 1][MAXN + 1];
int mono[MAXN + 1][MAXN + 1]; // mono[i][j] is # rooted trees with increasing paths with i nodes and the root having degree j
int monosum[MAXN + 1]; // monosum[i] is # rooted trees with increasing paths with i nodes and the root having degree 0..maxdeg-1

void run() {
	scanf("%d%d%d", &n, &maxdeg, &MOD);
	REPE(i, n) { C[i][0] = C[i][i] = 1; FOR(j, 1, i) C[i][j] = ((ll)C[i - 1][j - 1] + C[i - 1][j]) % MOD; }

	memset(mono, 0, sizeof(mono));
	mono[1][0] = 1; if (maxdeg != 0) monosum[1] = 1;
	FORE(i, 2, n) {
		FORE(j, 1, maxdeg) FORE(ii, 1, i - 1) {
			int ways = C[i - 2][ii - 1];
			ways = (ll)ways*monosum[ii] % MOD;
			ways = (ll)ways*mono[i - ii][j - 1] % MOD;
			mono[i][j] = ((ll)mono[i][j] + ways) % MOD;
		}
		monosum[i] = 0; REPE(j, maxdeg - 1) monosum[i] = ((ll)monosum[i] + mono[i][j]) % MOD;
	}

	int duo = 0;
	REPE(j, n) duo = ((ll)duo + mono[n][j]) % MOD;
	FORE(i, 3, n) FORE(j, 2, maxdeg) REPE(jj, maxdeg - j) {
		int ways = (ll)mono[i][j] * mono[n - i + 1][jj] % MOD;
		duo = ((ll)duo + ways) % MOD;
	}
	int paths = (ll)n*(n - 1) % MOD;
	int ret = (ll)2 * duo*paths%MOD;
	printf("%d\n", ret);
}

int main() {
	run();
	return 0;
}

#include<bits/stdc++.h>
#define maxn 210
using namespace std;
typedef long long ll;
int dp[maxn][maxn],ans,n,d,mod,g[maxn],C[maxn][maxn];
int main(){
	scanf("%d%d%d",&n,&d,&mod);
	g[1]=dp[1][0]=1;
	for(int i=0;i<=n;++i)
		for(int j=*C[i]=1;j<=i;++j)
			C[i][j]=(1ll*C[i-1][j]+C[i-1][j-1])%mod;
	ans=0;
	for(int i=2;i<=n;++i){
		for(int j=1;j<i;j++)
			for(int k=1;k<=d;++k)
				dp[i][k]=(dp[i][k]+1ll*dp[i-j][k-1]*g[j]%mod*C[i-2][j-1])%mod;
		for(int k=0;k<d;++k)g[i]=(1ll*g[i]+dp[i][k])%mod;
	}
	for(int i=0;i<n;++i)
		for(int j=0;j<=d;++j)
			for(int k=0;j+k<=d;++k)if(k!=1)
				ans=(ans+1ll*dp[i+1][j]*dp[n-i][k])%mod;
	ans=2ll*n*(n-1)*ans%mod;
	printf("%d",ans);
}

#include<bits/stdc++.h>
#define int long long
#define ri register int
#define pb push_back
#define fi first
#define se second
#define double long double
using namespace std;
const int rlen=1<<18|1;
char buf[rlen],*ib=buf,*ob=buf;
#define gc() getchar()
typedef long long ll;
typedef pair<int,int> pii;
inline int read(){
	int ans=0;
	char ch=gc();
	while(!isdigit(ch))ch=gc();
	while(isdigit(ch))ans=((ans<<2)+ans<<1)+(ch^48),ch=gc();
	return ans;
}
namespace modular{
	int mod;
	inline int add(int a,int b){return a+b<mod?a+b:a+b-mod;}
	inline int dec(int a,int b){return a<b?a-b+mod:a-b;}
	inline int mul(int a,int b){return (ll)a*b%mod;}
	inline void Add(int&a,int b){a=a+b<mod?a+b:a+b-mod;}
	inline void Dec(int&a,int b){a=a<b?a-b+mod:a-b;}
	inline void Mul(int&a,int b){a=(ll)a*b%mod;}
	inline int ksm(int a,int p){int ret=1;for(;p;p>>=1,Mul(a,a))(p&1)&&(Mul(ret,a),1);return ret;}
	inline int Inv(int a){return ksm(a,mod-2);}
	inline void fix(int&a){a=(a%mod+mod)%mod;}
}
using namespace modular;
const int N=205;
int C[N][N],n,K,f[N][N],s[N];
inline void init(){
	for(ri i=0;i<=n;++i){
		C[i][0]=1;
		for(ri j=1;j<=i;++j)C[i][j]=add(C[i-1][j-1],C[i-1][j]);
	}
}
signed main(){
	#ifdef ldxcaicai
	freopen("lx.in","r",stdin);
	#endif
	n=read(),K=read(),mod=read();
	init();
	s[1]=f[1][0]=1;
	for(ri i=2;i<=n;++i){
		for(ri j=1;j<=K;++j){
			for(ri k=1;k<i;++k)Add(f[i][j],mul(mul(f[i-k][j-1],s[k]),C[i-2][k-1]));
			if(j<K)Add(s[i],f[i][j]);
		}
	}
	int res=0;
	for(ri i=1;i<=n;++i)for(ri j=0;j<=K;++j)for(ri k=0;j+k<=K;k?++k:k+=2)Add(res,mul(f[i][j],f[n-i+1][k]));
	cout<<mul(mul(res,2),mul(n,n-1));
	return 0;
}

#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<string>
#include<algorithm>
#include<queue>
#include<vector>
#include<set>
#include<map>
using std::cin;using std::cerr;
using std::max;using std::min;
#define N 205
#define ll long long
#define db double
#define dbg1(x) cerr<<#x<<"="<<(x)<<" "
#define dbg2(x) cerr<<#x<<"="<<(x)<<"\n"
int n,m,mod;ll C[N][N],f[N][N],Sum[N],ans;
ll cal(ll x) {x-=x<mod?0:mod;return x;}
int main()
{
	scanf("%d%d%d",&n,&m,&mod),f[1][0]=Sum[1]=1;
	for(int i=0;i<=n;i++)
	{
		C[i][0]=1;
		for(int j=1;j<=i;j++) C[i][j]=cal(C[i-1][j]+C[i-1][j-1]);
	}
	for(int i=2;i<=n;i++)
		for(int j=1;j<=m;j++)
		{
			for(int k=1;k<i;k++)
				f[i][j]=cal(f[i][j]+f[i-k][j-1]*C[i-2][k-1]%mod*Sum[k]%mod);
			if(j<m) Sum[i]=cal(Sum[i]+f[i][j]);
		}
	for(int i=1;i<=n;i++)
		for(int j=0;j<=m;j++)
			for(int k=0;j+k<=m;k++) if(k^1) ans=cal(ans+f[i][j]*f[n-i+1][k]%mod);
	printf("%d\n",ans*2*n%mod*(n-1)%mod);
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
#define mp make_pair

ull INF;
ull MOD;
ull add(ull x, ull y) {
	x += y;
	if (x >= MOD) return x - MOD;
	return x;
}
ull sub(ull x, ull y) {
	if (x < y) x += MOD;
	return x - y;
}
ull mult(ull x, ull y) {
	return (x * y) % MOD;
}

const int N = 222;
ull C[N][N];
int d;
ull a[N];
ull b[N][N];
ull dp[N][N];

ull solve(int n) {
	for (int i = 0; i <= min(n - 1, d); i++)
		for (int j = 0; j < n; j++)
			dp[i][j] = 0;
	dp[0][n - 1] = 1 % MOD;
	for (int i = 0; i < min(n - 1, d); i++)
		for (int x = 0; x < n; x++) {
			dp[i][x] %= MOD;
			if (dp[i][x] == 0) continue;
			for (int y = 1; y <= x; y++) {
				dp[i + 1][x - y] += dp[i][x] * ((a[y] * C[x - 1][y - 1]) % MOD) % MOD;
			}
		}
	ull res = 0;
	for (int i = 0; i <= min(n - 1, d); i++) {
		b[n][i] = dp[i][0] % MOD;
		res += dp[i][0] % MOD;
	}
	return res % MOD;
}

int main()
{
//	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);

	int n;
	scanf("%d%d%llu", &n, &d, &MOD);
	if (n == 1) {
		throw;
		printf("0\n");
		return 0;
	}
	if (n == 2) {
		ull ans = 4;
		printf("%llu\n", ans % MOD);
		return 0;
	}
	if (d == 1) {
		printf("0\n");
		return 0;
	}

	d--;
	for (int i = 0; i < N; i++)
		C[i][0] = C[i][i] = 1 % MOD;
	for (int i = 1; i < N; i++)
		for (int j = 1; j < i; j++)
			C[i][j] = add(C[i - 1][j - 1], C[i - 1][j]);
	a[0] = 1 % MOD;
	for (int i = 1; i < n; i++)
		a[i] = solve(i);
	d++;
	a[n] = solve(n);

	ull ans = sub(a[n], b[n][1]);
	ans = add(ans, ans);

	for (int x = 1; x < n - 1; x++) {
		ull sum = 0;
		for (int i = 2; i <= d - 2; i++)
			sum = add(sum, b[n - x][i]);
		for (int i = 2; i <= d - 2; i++) {
			ans = add(ans, mult(sum, b[x + 1][i]));
			sum = sub(sum, b[n - x][d - i]);
		}
	}
	for (int x = 1; x <= n; x++)
		for (int y = 1; x + y <= n; y++)
			ans = add(ans, mult(sub(a[x], b[x][1]), sub(a[y], b[y][1])));

	ans *= n * (n - 1) * 2;
	ans %= MOD;
	printf("%llu\n", ans);

	return 0;
}

#include <bits/stdc++.h>

using namespace std;

#define X first
#define Y second
#define mp make_pair
#define pb push_back
#define Debug(...) fprintf(stderr, __VA_ARGS__)

typedef long long LL;
typedef long double LD;
typedef unsigned int uint;
typedef pair <int, int> pii;
typedef unsigned long long uLL;

template <typename T> inline void Read(T &x) {
  char c = getchar();
  bool f = false;
  for (x = 0; !isdigit(c); c = getchar()) {
    if (c == '-') {
      f = true;
    }
  }
  for (; isdigit(c); c = getchar()) {
    x = x * 10 + c - '0';
  }
  if (f) {
    x = -x;
  }
}

template <typename T> inline bool CheckMax(T &a, const T &b) {
  return a < b ? a = b, true : false;
}

template <typename T> inline bool CheckMin(T &a, const T &b) {
  return a > b ? a = b, true : false;
}

const int N = 205;

uint ans, mod, c[N][N], f[N][N], s[N][N];
int n, m;

int main() {
#ifdef wxh010910
  freopen("d.in", "r", stdin);
#endif
  Read(n), Read(m), Read(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] + c[i - 1][j - 1]) % mod;
    }
  }
  f[1][0] = 1;
  for (int i = 0; i <= m; ++i) {
    s[1][i] = 1;
  }
  for (int i = 2; i <= n; ++i) {
    for (int j = 1; j < i; ++j) {
      for (int k = 0; k < m; ++k) {
        f[i][k + 1] = (1LL * s[j][m - 1] * c[i - 2][j - 1] % mod * f[i - j][k] + f[i][k + 1]) % mod;
      }
    }
    for (int j = 1; j <= m; ++j) {
      s[i][j] = (s[i][j - 1] + f[i][j]) % mod;
    }
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j <= m; ++j) {
      for (int k = 0; j + k <= m; ++k) {
        if (k != 1) {
          ans = (1LL * f[i + 1][j] * f[n - i][k] + ans) % mod;
        }
      }
    }
  }
  ans = 2LL * n * (n - 1) * ans % mod;
  printf("%u\n", ans);
#ifdef wxh010910
  Debug("My Time: %.3lfms\n", (double)clock() / CLOCKS_PER_SEC);
#endif
  return 0;
}

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
using namespace std;

#ifdef LOCAL
	#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
	#define eprintf(...) 42
#endif

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
#define mp make_pair

ull INF;
ull MOD;
ull add(ull x, ull y) {
	x += y;
	if (x >= MOD) return x - MOD;
	return x;
}
ull sub(ull x, ull y) {
	if (x < y) x += MOD;
	return x - y;
}
ull mult(ull x, ull y) {
	return (x * y) % MOD;
}

const int N = 222;
ull C[N][N];
int d;
ull a[N];
ull b[N][N];
ull dp[N][N];

ull solve(int n) {
	for (int i = 0; i <= min(n - 1, d); i++)
		for (int j = 0; j < n; j++)
			dp[i][j] = 0;
	dp[0][n - 1] = 1 % MOD;
	for (int i = 0; i < min(n - 1, d); i++)
		for (int x = 0; x < n; x++) {
			dp[i][x] %= MOD;
			if (dp[i][x] == 0) continue;
			for (int y = 1; y <= x; y++) {
				dp[i + 1][x - y] += dp[i][x] * ((a[y] * C[x - 1][y - 1]) % MOD) % MOD;
			}
		}
	ull res = 0;
	for (int i = 0; i <= min(n - 1, d); i++) {
		b[n][i] = dp[i][0] % MOD;
		res += dp[i][0] % MOD;
	}
	return res % MOD;
}

int main()
{
//	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);

	int n;
	scanf("%d%d%llu", &n, &d, &MOD);
	if (n == 1) {
		throw;
		printf("0\n");
		return 0;
	}
	if (n == 2) {
		ull ans = 4;
		printf("%llu\n", ans % MOD);
		return 0;
	}
	if (d == 1) {
		printf("0\n");
		return 0;
	}

	d--;
	for (int i = 0; i < N; i++)
		C[i][0] = C[i][i] = 1 % MOD;
	for (int i = 1; i < N; i++)
		for (int j = 1; j < i; j++)
			C[i][j] = add(C[i - 1][j - 1], C[i - 1][j]);
	a[0] = 1 % MOD;
	for (int i = 1; i < n; i++)
		a[i] = solve(i);
	d++;
	a[n] = solve(n);

	ull ans = sub(a[n], b[n][1]);
	ans = add(ans, ans);

	for (int x = 1; x < n - 1; x++) {
		ull sum = 0;
		for (int i = 2; i <= d - 2; i++)
			sum = add(sum, b[n - x][i]);
		for (int i = 2; i <= d - 2; i++) {
			ans = add(ans, mult(sum, b[x + 1][i]));
			sum = sub(sum, b[n - x][d - i]);
		}
	}
	for (int x = 1; x <= n; x++)
		for (int y = 1; x + y <= n; y++)
			ans = add(ans, mult(sub(a[x], b[x][1]), sub(a[y], b[y][1])));

	ans *= n * (n - 1) * 2;
	ans %= MOD;
	printf("%llu\n", ans);

	return 0;
}

#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <string.h>

using namespace std;

const int maxn = 205;
typedef long long LL;

int f[maxn][maxn];
int s[maxn][maxn];
int c[maxn][maxn],ans,n,m,mod;
int main()
{
	#ifndef ONLINE_JUDGE
//		freopen("trees.in","r",stdin);
	#endif
	scanf("%d %d %d",&n,&m,&mod);
	for (int i=0;i<=n;i++)
	{
		c[i][0]=c[i][i]=1;
		for (int j=1;j<i;j++)
			c[i][j]=((LL)c[i-1][j-1]+c[i-1][j])%mod;
	}
	f[1][0]=1;
	for (int i=0;i<=m;i++) s[1][i]=1;

	for (int i=2;i<=n;i++)
	{
		for (int j=1;j<=m;j++)
		for (int k=1;k<i;k++)
			f[i][j]=(f[i][j]+(LL)f[i-k][j-1]*(LL)s[k][m-1]%mod*(LL)c[i-2][k-1])%mod;
		for (int j=1;j<=m;j++)
			s[i][j]=((LL)s[i][j-1]+f[i][j])%mod;
	}

	int ans=0;
	for (int i=1;i<=n;i++)
	for (int j=0;j<=m;j++)
	for (int k=0;j+k<=m;k++)
		if (k!=1) ans=(ans+(LL)f[i][j]*f[n-i+1][k])%mod;
	ans=(LL)ans*n%mod*(n-1)%mod*2ll%mod;
	printf("%d",ans%mod);
	return 0;
}

/*
  Beautiful Codes are MUCH better than 'Shorter' ones !
user  : triveni
date  : 03/02/2018
time  : 05:25:05
*/
#include <bits/stdc++.h>

using namespace std;

#define      pii               std::pair<int,int>
#define      vi                std::vector<int>
#define      sz(v)             (int)(v.size())
#define      mp(a,b)           make_pair(a,b)
#define      pb(a)             push_back(a)
#define      each(it,s)        for(auto it = s.begin(); it != s.end(); ++it)
#define      rep(i, n)         for(int i = 0; i < (n); ++i)
#define      fill(a,v)         memset(a, v, sizeof (a))
#define      all(v)            v.begin(), v.end()
#define      scan(n)           scanf("%d", &n)
#define      scan2(n, m)       scanf("%d%d", &n, &m)
#define      pin(n)            printf("%d\n",n)
#define      pll(n)            printf("%lld\n", n)
#define      X                 first
#define      Y                 second

typedef unsigned int uint;
uint mod = 1000000007;

inline int pow_(long long a, int n, int p=mod){
int r=1;while(n){if(n&1)r=r*a%p;n>>=1;a=a*a%p;}return r;}
inline int inv_(int a) {return pow_(a, mod-2, mod);}
inline uint add(uint a, uint b){a+=b;if(a>=mod)a-=mod;return a;}
inline uint mul(uint a, uint b){return a*1ll*b%mod;}
inline int sub(int a, int b){a-=b;if(a<0)a+=mod;return a;}

uint d, dp[210][210];
uint ncr[210][210];

uint treeCnt(uint n, uint deg) {
	uint & r = dp[n][deg];
	if (~r) return r; else r = 0;
	if (deg >= n) return r;
	if (deg == 0) return r = (n == 1);

	if(deg == 1) {
		rep(dg, d) r = add(r, treeCnt(n-1, dg));
		return r;
	}

	for (int s = 2; s < n; ++s) {
		int tmp = mul(treeCnt(s, 1), treeCnt(n - s + 1, deg - 1));
		tmp = mul(tmp, ncr[n-2][s-2]);
		r = add(r, tmp);
	}
	return r;
}

main()
{
	uint n = 100; d = 50;
	scanf("%u%u%u", &n, &d, &mod);
	fill(dp, -1);

	rep(i, 210) rep(j, 210) if(i==j||j==0) ncr[i][j] = 1;
		else ncr[i][j]=add(ncr[i-1][j-1], ncr[i-1][j]);

	uint ans = 0;
	for (uint deg = 1; deg <= d; ++deg) {
		for (uint d1 = 0; d1 <= deg; ++d1) if(d1 != 1) {
			for (uint n1 = 0; n1 < n; ++n1) {
				uint tmp = mul(treeCnt(n - n1, deg - d1), treeCnt(n1 + 1, d1));
				ans = add(ans, tmp);
			}
		}
	}
	ans = mul(ans, 2 * n * (n - 1));
	pin((int)ans);
	return 0;
}

/*
  Beautiful Codes are MUCH better than 'Shorter' ones !
user  : triveni
date  : 03/02/2018
time  : 05:25:05
*/
#include <bits/stdc++.h>

using namespace std;

#define      pii               std::pair<int,int>
#define      vi                std::vector<int>
#define      sz(v)             (int)(v.size())
#define      mp(a,b)           make_pair(a,b)
#define      pb(a)             push_back(a)
#define      each(it,s)        for(auto it = s.begin(); it != s.end(); ++it)
#define      rep(i, n)         for(int i = 0; i < (n); ++i)
#define      fill(a,v)         memset(a, v, sizeof (a))
#define      all(v)            v.begin(), v.end()
#define      scan(n)           scanf("%d", &n)
#define      scan2(n, m)       scanf("%d%d", &n, &m)
#define      pin(n)            printf("%d\n",n)
#define      pll(n)            printf("%lld\n", n)
#define      X                 first
#define      Y                 second

typedef long long ll;
ll mod = 1000000007;
#define int ll

inline int pow_(long long a, int n, int p=mod){
int r=1;while(n){if(n&1)r=r*a%p;n>>=1;a=a*a%p;}return r;}
inline int inv_(int a) {return pow_(a, mod-2, mod);}
inline int add(int a, int b){a+=b;if(a>=mod)a-=mod;return a;}
inline int mul(int a, int b){return a*1L*b%mod;}
inline int sub(int a, int b){a-=b;if(a<0)a+=mod;return a;}

int d, dp[210][210];
int ncr[210][210];

int treeCnt(int n, int deg) {
	int & r = dp[n][deg];
	if (r >= 0) return r; else r = 0;
	if (deg >= n) return r;
	if (deg == 0) return r = (n == 1);

	if(deg == 1) {
		rep(dg, d) r = add(r, treeCnt(n-1, dg));
		return r;
	}

	for (int s = 2; s < n; ++s) {
		int tmp = mul(treeCnt(s, 1), treeCnt(n - s + 1, deg - 1));
		tmp = mul(tmp, ncr[n-2][s-2]);
		r = add(r, tmp);
	}
	return r;
}

main()
{
	int n = 100; d = 50;
	scanf("%lld%lld%lld", &n, &d, &mod);
	fill(dp, -1);

	rep(i, 210) rep(j, 210) if(i==j||j==0) ncr[i][j] = 1;
		else ncr[i][j]=add(ncr[i-1][j-1], ncr[i-1][j]);

	vector<int> ans(d + 1);
	for (int deg = 1; deg <= d; ++deg) {
		for (int d1 = 0; d1 <= deg; ++d1) if(d1 != 1) {
			for (int n1 = 0; n1 < n; ++n1) {
				int tmp = mul(treeCnt(n - n1, deg - d1), treeCnt(n1 + 1, d1));
				ans[deg] = add(ans[deg], tmp);
			}
		}
	}
	int f_ans = accumulate(all(ans), 0LL) % mod;
	f_ans = mul(f_ans, 2 * n * (n-1));
	pll(f_ans);

	return 0;
}

#include<cstdio>
const int maxn=210;

long long n,d,MOD,c[maxn][maxn],sum[maxn],ans,f[maxn][maxn];
int main(){
    scanf("%lld%lld%lld",&n,&d,&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;
    }
    f[1][0]=sum[1]=1;
    for(int i=2;i<=n;i++){
        for(int j=1;j<=d;j++){
            for(int k=1;k<i;k++){
                f[i][j]=(f[i][j]+f[i-k][j-1]*c[i-2][k-1]%MOD*sum[k])%MOD;
            }
            if(j!=d)sum[i]=(sum[i]+f[i][j])%MOD;
        }
    }
    for(int i=1;i<=n;i++)
        for(int j=0;j<=d;j++)
            for(int k=0;j+k<=d;k++)if(k!=1)
                ans=(ans+f[i][j]*f[n-i+1][k])%MOD;
    printf("%lld\n",2ll*n*(n-1)%MOD*ans%MOD);
    return 0;
}

// #define DEBUG
//#define USEPB_DS
#define USETR1
#define CPPELEVEN
#define GPP

/*
 * temp.cpp
 *
 *  Created on: 2012-7-18
 *      Author: BSBandme
 */
//#pragma comment(linker, "/STACK:1024000000,1024000000")

#include <iostream>
#include <fstream>
#include <string.h>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <cassert>
#include <list>
#include <iomanip>
#include <math.h>
#include <deque>
#include <utility>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <climits>
#include <cctype>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <functional>
#include <sstream>
#include <tuple>

using namespace std;

#ifndef CPPELEVEN
#ifdef USETR1
#include <tr1/unordered_map>
#include <tr1/unordered_set>
using namespace tr1;
#endif
#else
#include <unordered_map>
#include <unordered_set>
#endif

#ifdef USEPB_DS
#include <ext/pb_ds/priority_queue.hpp>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
// binomial_heap_tag, rc_binomial_heap_tag, thin_heap_tag, binary_heap_tag
typedef __gnu_pbds::priority_queue<int, greater<int>, pairing_heap_tag> pq_type;
// splay_tree_tag, ov_tree_tag
typedef tree <int, null_type, less <int>, rb_tree_tag, tree_order_statistics_node_update> tree_type;
#endif

#define mpr make_pair
typedef unsigned int ui;
typedef unsigned long long ull;
typedef long long ll;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef pair <double, double> pdd;
typedef vector <int> vi;
typedef vector <ll> vll;
typedef vector <double> vd;
typedef vector <string> vs;
typedef map <string, int> mpsi;
typedef map <double, int> mpdi;
typedef map <int, int> mpii;

const double pi = acos(0.0) * 2.0;
const long double eps = 1e-10;
const int step[8][2] = {{-1, 0}, {0, 1}, {1, 0}, {0, -1}, {-1, 1}, {1, 1}, {1, -1}, {-1, -1}};

template <class T> inline T abs1(T a) {return a < 0 ? -a : a;}

#ifndef CPPELEVEN
template <class T> inline T max1(T a, T b) { return b < a ? a : b; }
template <class T> inline T max1(T a, T b, T c) { return max1(max1(a, b), c); }
template <class T> inline T max1(T a, T b, T c, T d) { return max1(max1(a, b, c), d); }
template <class T> inline T max1(T a, T b, T c, T d, T e) { return max1(max1(a, b, c, d), e); }
template <class T> inline T min1(T a, T b) { return a < b ? a : b; }
template <class T> inline T min1(T a, T b, T c) { return min1(min1(a, b), c); }
template <class T> inline T min1(T a, T b, T c, T d) { return min1(min1(a, b, c), d); }
template <class T> inline T min1(T a, T b, T c, T d, T e) { return min1(min1(a, b, c, d), e); }
#else
template <typename t, typename t1>
t min1(t a, t1 b) { return a < b ? a : b; }
template <typename t, typename... arg>
t min1(t a, arg... arr) { return min1(a, min1(arr...)); }
template <typename t, typename t1>
t max1(t a, t1 b) { return a > b ? a : b; }
template <typename t, typename... arg>
t max1(t a, arg... arr) { return max1(a, max1(arr...)); }
#endif

inline int jud(double a, double b){
	if(abs(a) < eps && abs(b) < eps) return 0;
	else if(abs1(a - b) / max(abs1(a), abs1(b)) < eps) return 0;
	if(a < b) return -1;
	return 1;
}
template <typename t> inline int jud(t a, t b){
	if(a < b) return -1;
	if(a == b) return 0;
	return 1;
}

// f_lb == 1代表返回相同的一串的左边界，f_small == 1代表返回如果没有寻找的值返回小的数
template <typename it, typename t1>
inline int find(t1 val, it a, int na, bool f_small = 1, bool f_lb = 1){
	if(na == 0) return 0;
	int be = 0, en = na - 1;
	if(*a <= *(a + na - 1)){
		if(f_lb == 0) while(be < en){
			int mid = (be + en + 1) / 2;
			if(jud(*(a + mid), val) != 1) be = mid;
			else en = mid - 1;
		}else while(be < en){
			int mid = (be + en) / 2;
			if(jud(*(a + mid), val) != -1) en = mid;
			else be = mid + 1;
		}
		if(f_small && jud(*(a + be), val) == 1) be--;
		if(!f_small && jud(*(a + be), val) == -1) be++;
	} else {
		if(f_lb) while(be < en){
			int mid = (be + en + 1) / 2;
			if(jud(*(a + mid), val) != -1) be = mid;
			else en = mid - 1;
		}else while(be < en){
			int mid = (be + en) / 2;
			if(jud(*(a + mid), val) != 1) en = mid;
			else be = mid + 1;
		}
		if(!f_small && jud(*(a + be), val) == -1) be--;
		if(f_small && jud(*(a + be), val) == 1) be++;
	}
	return be;
}

template <class T> inline T lowb(T num) {return num & (-num); }
#ifdef GPP
inline int bitnum(ui nValue) { return __builtin_popcount(nValue); }
inline int bitnum(int nValue) { return __builtin_popcount(nValue); }
inline int bitnum(ull nValue) { return __builtin_popcount(nValue) + __builtin_popcount(nValue >> 32); }
inline int bitnum(ll nValue) { return __builtin_popcount(nValue) + __builtin_popcount(nValue >> 32); }
inline int bitmaxl(ui a) { if(a == 0) return 0; return 32 - __builtin_clz(a); }
inline int bitmaxl(int a) { if(a == 0) return 0; return 32 - __builtin_clz(a); }
inline int bitmaxl(ull a) { int temp = a >> 32; if(temp) return 32 - __builtin_clz(temp) + 32; return bitmaxl(int(a)); }
inline int bitmaxl(ll a) { int temp = a >> 32; if(temp) return 32 - __builtin_clz(temp) + 32; return bitmaxl(int(a)); }
#else
#endif

long long pow(long long n, long long m, long long mod = 0){
	if(m < 0) return 0;
	long long ans = 1;
	long long k = n;
	while(m){
		if(m & 1) {
			ans *= k;
			if(mod) ans %= mod;
		}
		k *= k;
		if(mod) k %= mod;
		m >>= 1;
	}
	return ans;
}

#define  MOD 1000000007
template <class t1, class t2>
inline void add(t1 &a, t2 b, int mod = -1) {
	if(mod == -1) mod = MOD;
	a += b;
	while(a >= mod) a -= mod;
	while(a < 0) a += mod;
}
template <class t>
void output1(t arr) {
	for(int i = 0; i < (int)arr.size(); i++)
		cerr << arr[i] << ' ';
	cerr << endl;
}
template <class t>
void output2(t arr) {
	for(int i = 0; i < (int)arr.size(); i++)
		output1(arr[i]);
}

//....................密..........封..........线..........下..........禁..........止..........hack...............................................

const int maxn = 210;
ll mono[maxn][maxn], sum_mono[maxn][maxn], multi_mono[maxn][maxn];
ll c[maxn][maxn];
int n, d, mod;

int main() {

//............................不要再忘了检查maxn大小了！！！！BSBandme你个SB！！！！...................................................

	ios_base::sync_with_stdio(0);
	#ifdef DEBUG //......................................................................................................
	freopen("input.txt", "r", stdin);
	int __size__ = 256 << 20; // 256MB
	char *__p__ = (char*)malloc(__size__) + __size__;
	__asm__("movl %0, %%esp\n" :: "r"(__p__));
	#endif //...........................................................................................................

	scanf("%d%d%d", &n, &d, &mod);

	for (int i = 0; i < maxn; i++) {
		c[i][0] = 1;
		for (int j = 1; j < maxn; j++) {
			c[i][j] = c[i - 1][j] + c[i - 1][j - 1];
			c[i][j] %= mod;
		}
	}

	mono[1][0] = 1;
	for (int i = 0; i <= d; i++) sum_mono[1][i] = 1;
	multi_mono[0][0] = 1;
	multi_mono[1][1] = 1;
	for (int i = 2; i <= n; i++) {
		for (int j = 1; j <= i - 1; j++) {
			for (int rd = 0; rd <= d - 1; rd++) {
				mono[i][rd + 1] += mono[i - j][rd] * c[i - 2][j - 1] % mod  * sum_mono[j][d - 1];
				mono[i][rd + 1] %= mod;
			}
			for (int rd = 1; rd <= d - 1; rd++) {
				multi_mono[i][rd + 1] += multi_mono[j][rd] * multi_mono[i - j][1] % mod * c[i - 1][i - j - 1];
				multi_mono[i][rd + 1] %= mod;
			}
		}
		sum_mono[i][0] = mono[i][0];
		for (int rd = 1; rd <= d; rd++) {
			sum_mono[i][rd] = mono[i][rd] + sum_mono[i][rd - 1];
			sum_mono[i][rd] %= mod;
		}
		multi_mono[i][1] = sum_mono[i][d - 1];
	}

	ll ans = 0;
	for (int i = 0; i < n; i++)
		for (int rd_small = 0; rd_small <= d; rd_small++) {
			ans += multi_mono[i][rd_small] * multi_mono[n - i - 1][0];
			ans %= mod;
			for (int rd_big = 2; rd_big + rd_small <= d; rd_big++) {
				ans += multi_mono[i][rd_small] * multi_mono[n - i - 1][rd_big];
				ans %= mod;
			}
		}
	cout << ans * 2 * (n - 1) % mod * n % mod << endl;

    return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=205;
int n,d,m,f[N][N],c[N][N],g[N];
inline void add(int&x,int y){x=(ll)x+y<m?x+y:(ll)x+y-m;}
inline int he(int x,int y){return (ll)x+y<m?x+y:(ll)x+y-m;}
int main(){
	//freopen("aa.in","r",stdin);
	int i,j,k;
	scanf("%d%d%d",&n,&d,&m);
	for(c[0][0]=i=1;i<=n;++i)for(c[i][0]=j=1;j<=i;++j)c[i][j]=he(c[i-1][j],c[i-1][j-1]);
	f[1][0]=g[1]=1;
	for(i=2;i<=n;++i){
		for(j=1;j<=d;++j){
			for(k=1;k<i;++k){
				add(f[i][j],1LL*f[k][j-1]*g[i-k]%m*c[i-2][k-1]%m);
			}
			if(j<d)add(g[i],f[i][j]);
		}
	}
	int ans=0;
	for(i=1;i<=n;++i){
		for(j=0;j<=d;++j){
			for(k=0;k<=d-j;++k)if(k!=1){
				add(ans,1LL*f[i][j]*f[n+1-i][k]%m);
			}
		}
	}
	ans=2LL*ans*n*(n-1)%m;
	printf("%d",ans);
	return 0;
}

#include <bits/stdc++.h>

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define SZ(x) ((int) (x).size())
#define ALL(x) x.begin(), x.end()

using namespace std;
typedef long long LL;
typedef unsigned int uint;

template <typename T> inline bool cmin(T & a, const T & b) { return a > b ? a = b, 1 : 0;}
template <typename T> inline bool cmax(T & a, const T & b) { return a < b ? a = b, 1 : 0;}

const int MaxN = 205;
uint n, d, M, c[MaxN][MaxN], f[MaxN][MaxN], g[MaxN];

int main() {
	cin >> n >> d >> M;
	c[0][0] = 1;
	for (int i = 1; i <= n; i++) {
		c[i][0] = 1;
		for (int j = 1; j <= i; j++)
			c[i][j] = (c[i - 1][j] + c[i - 1][j - 1]) % M;
	}
	f[1][0] = 1;
	for (int i = 2; i <= n; i++) {
		for (int k = 0; k < d; k++)
			(g[i - 1] += f[i - 1][k]) %= M;
		for (int j = 1; j < i; j++)
			for (int k = 0; k < d; k++)
				f[i][k + 1] = (f[i][k + 1] + (LL) f[i - j][k] * g[j] % M * c[i - 2][j - 1]) % M;
	}
	int ans = 0;
	for (int i = 0; i < n; i++)
		for (int j = 0; j <= d; j++)
			for (int k = 0; j + k <= d; k++) {
				if(k == 1) continue;
				ans = (ans + (LL) f[i + 1][j] * f[n - i][k]) % M;
			}
	ans = (LL) ans * 2 * n * (n - 1) % M;
	cout << ans << endl;
	return 0;
}

#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define SZ(x) ((int)x.size())
#define L(i,u) for (register int i=head[u]; i; i=nxt[i])
#define rep(i,a,b) for (register int i=(a); i<=(b); i++)
#define per(i,a,b) for (register int i=(a); i>=(b); i--)
using namespace std;
typedef long long ll;
typedef unsigned int ui;
typedef pair<int,int> Pii;
typedef vector<int> Vi;
template<class T> inline void read(T &x){
	x=0; char c=getchar(); int f=1;
	while (!isdigit(c)) {if (c=='-') f=-1; c=getchar();}
	while (isdigit(c)) {x=x*10+c-'0'; c=getchar();} x*=f;
}
template<class T> inline void umin(T &x, T y){x=x<y?x:y;}
template<class T> inline void umax(T &x, T y){x=x>y?x:y;}
inline ui R() {
	static ui seed=416;
	return seed^=seed>>5,seed^=seed<<17,seed^=seed>>13;
}
const int N = 205;
int n,d;ll dp[N],f[N][N],C[N][N];int mo;
inline void add(ll&a,ll b){a=a+b<mo?a+b:a+b-mo;}
int main() {
	read(n);read(d);read(mo);f[0][0]=1;
	if(d==1){
		if(n>=3){puts("0");return 0;}
	}
	rep(i,0,n){
		C[i][0]=C[i][i]=1;
		rep(j,1,i-1)C[i][j]=(C[i-1][j-1]+C[i-1][j])%mo;
	}
	rep(i,1,n){
		rep(j,1,d-1)add(dp[i],f[j][i-1]);if(i==1)dp[i]=1;
		rep(j,1,i)rep(k,1,i)
			f[j][i]=(f[j][i]+1LL*C[i-1][k-1]*dp[k]%mo*f[j-1][i-k])%mo;
	//	printf("%d:%d\n",i,dp[i]);
	//	rep(j,1,i)printf("%d %d : %d\n",j,i,f[j][i]);
	}
	ll res=0;
	rep(l,1,n)rep(r,l+1,n)res=(res+1LL*(l==1?1:dp[l]-f[1][l-1])*(r==n?1:dp[n-r+1]-f[1][n-r]))%mo;
	rep(p,2,n-1)rep(i,2,d)rep(j,2,d-i)res=(res+1LL*f[i][p-1]*f[j][n-p])%mo;
	rep(i,2,d)res=(res+2LL*f[i][n-1])%mo;
	res=2LL*res*n*(n-1)%mo;
	cout<<(res%mo+mo)%mo;
	return 0;
}

#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define SZ(x) ((int)x.size())
#define L(i,u) for (register int i=head[u]; i; i=nxt[i])
#define rep(i,a,b) for (register int i=(a); i<=(b); i++)
#define per(i,a,b) for (register int i=(a); i>=(b); i--)
using namespace std;
typedef long long ll;
typedef unsigned int ui;
typedef pair<int,int> Pii;
typedef vector<int> Vi;
template<class T> inline void read(T &x){
	x=0; char c=getchar(); int f=1;
	while (!isdigit(c)) {if (c=='-') f=-1; c=getchar();}
	while (isdigit(c)) {x=x*10+c-'0'; c=getchar();} x*=f;
}
template<class T> inline void umin(T &x, T y){x=x<y?x:y;}
template<class T> inline void umax(T &x, T y){x=x>y?x:y;}
inline ui R() {
	static ui seed=416;
	return seed^=seed>>5,seed^=seed<<17,seed^=seed>>13;
}
const int N = 205;
int n,d;ll dp[N],f[N][N],C[N][N];int mo;
inline void add(ll&a,ll b){a=a+b<mo?a+b:a+b-mo;}
int main() {
	read(n);read(d);read(mo);f[0][0]=1;
	if(d==1){
		if(n>=3){puts("0");return 0;}
	}
	rep(i,0,n){
		C[i][0]=C[i][i]=1;
		rep(j,1,i-1)C[i][j]=(C[i-1][j-1]+C[i-1][j])%mo;
	}
	rep(i,1,n){
		rep(j,1,d-1)add(dp[i],f[j][i-1]);if(i==1)dp[i]=1;
		rep(j,1,i)rep(k,1,i)
			f[j][i]=(f[j][i]+1LL*C[i-1][k-1]*dp[k]%mo*f[j-1][i-k])%mo;
	//	printf("%d:%d\n",i,dp[i]);
	//	rep(j,1,i)printf("%d %d : %d\n",j,i,f[j][i]);
	}
	ll res=0;
	rep(p,1,n)rep(i,0,d)if(i!=1)rep(j,0,d-i)res=(res+1LL*f[i][p-1]*f[j][n-p])%mo;
	res=2LL*res*n*(n-1)%mo;
	cout<<(res%mo+mo)%mo;
	return 0;
}

#include<bits/stdc++.h>
const int N=210;
int n,d,mod,ans,C[N][N],dp[N][N],sum[N];
int main(){
#ifdef memset0
	freopen("1.in","r",stdin);
#endif
	scanf("%d%d%d",&n,&d,&mod);
	for(int i=0;i<=n;i++){
		C[i][0]=1;
		for(int j=1;j<=i;j++)C[i][j]=((long long)C[i-1][j-1]+C[i-1][j])%mod;
	}
	for(int i=1;i<=n;i++){
		if(i==1){
			dp[1][0]=1;
		}else{
			dp[i][1]=sum[i-1];
			for(int j=2;j<i&&j<=d;j++)
				for(int k=1;k<i;k++){
					dp[i][j]=(dp[i][j]+(long long)dp[k][j-1]*sum[i-k]%mod*C[i-2][k-1])%mod;
				}
		}
		for(int j=0;j<d;j++)sum[i]=((long long)sum[i]+dp[i][j])%mod;
	}
	// for(int i=1;i<=n;i++)
	// 	for(int j=0;j<=d;j++)
	// 		printf("%d%c",dp[i][j]," \n"[j==d]);
	for(int i=1;i<=n;i++)
		for(int j=0;j<=d;j++)
			for(int k=0;j+k<=d;k++){
				ans=(ans+(long long)dp[i][j]*dp[n-i+1][k])%mod;
			}
	for(int i=1;i<=n;i++)
		for(int j=0;j<d;j++)
			for(int k=0;k<d;k++){
				ans=(ans-(long long)dp[i][j]*dp[n-i][k])%mod;
			}
	ans=(long long)ans*n%mod*(n-1)%mod*2%mod;
	printf("%d\n",ans<0?ans+mod:ans);
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const int N=205;
int n,d;ui m,f[N][N],c[N][N],g[N];
inline void add(ui&x,ui y){x=x+y<m?x+y:x+y-m;}
inline ui he(ui x,ui y){return x+y<m?x+y:x+y-m;}
int main(){
	//freopen("aa.in","r",stdin);
	int i,j,k;
	scanf("%d%d%u",&n,&d,&m);
	for(c[0][0]=i=1;i<=n;++i)for(c[i][0]=j=1;j<=i;++j)c[i][j]=he(c[i-1][j],c[i-1][j-1]);
	f[1][0]=g[1]=1;
	for(i=2;i<=n;++i){
		for(j=1;j<=d;++j){
			for(k=1;k<i;++k){
				add(f[i][j],1LL*f[k][j-1]*g[i-k]%m*c[i-2][k-1]%m);
			}
			if(j<d)add(g[i],f[i][j]);
		}
	}
	ui ans=0;
	for(i=1;i<=n;++i){
		for(j=0;j<=d;++j){
			for(k=0;k<=d-j;++k)if(k!=1){
				add(ans,1LL*f[i][j]*f[n+1-i][k]%m);
			}
		}
	}
	ans=2LL*ans*n*(n-1)%m;
	printf("%u",ans);
	return 0;
}

#include <bits/stdc++.h>
#define mset(a, b) memset(a, b, sizeof(a))
#define mcpy(a, b) memcpy(a, b, sizeof(a))
using namespace std;
typedef long long LL;
const int N = 205;

template <typename T> inline void read(T &AKNOI) {
	T x = 0, flag = 1;
	char ch = getchar();
	while (!isdigit(ch)) {
		if (ch == '-') flag = -1;
		ch = getchar();
	}
	while (isdigit(ch)) {
		x = x * 10 + ch - '0';
		ch = getchar();
	}
	AKNOI = flag * x;
}

namespace ModCalculator {
	LL MOD;
	inline void Inc(LL &x, LL y) {
		x += y; if (x >= MOD) x -= MOD;
	}
	inline void Dec(LL &x, LL y) {
		x -= y; if (x < 0) x += MOD;
	}
	inline LL Add(LL x, LL y) {
		Inc(x, y); return x;
	}
	inline LL Sub(LL x, LL y) {
		Dec(x, y); return x;
	}
	inline LL Mul(LL x, LL y) {
		return x * y % MOD;
	}
}
using namespace ModCalculator;

int n, d;
LL C[N][N], dp[N][N], sum[N], ans;

void init() {
	read(n); read(d); read(MOD);
	for (int i = 0; i <= n; ++i) {
		C[i][0] = 1;
		for (int j = 1; j <= i; ++j) {
			C[i][j] = Add(C[i - 1][j], C[i - 1][j - 1]);
		}
	}
}

void solve() {
	dp[1][0] = sum[1] = 1;
	for (int i = 2; i <= n; ++i) {
		for (int j = 1; j <= d; ++j) {
			for (int k = 1; k < i; ++k) {
				Inc(dp[i][j], Mul(C[i - 2][k - 1], Mul(sum[k], dp[i - k][j - 1])));
			}
			if (j < d) Inc(sum[i], dp[i][j]);
		}
	}
	for (int i = 1; i <= n; ++i) {
		for (int j = 0; j <= d; ++j) {
			for (int k = 0; k + j <= d; ++k) {
				if (k == 1) continue;
				Inc(ans, Mul(dp[i][j], dp[n - i + 1][k]));
			}
		}
	}
	printf("%lld\n", Mul(ans, 2LL * n * (n - 1)));
}

int main() {
	init();
	solve();
	return 0;
}

#include "iostream"
#include "algorithm"
#include "cstring"
#include "cstdio"
#include "cmath"
#include "vector"
#include "map"
#include "set"
#include "queue"
using namespace std;
#define MAXN 5006
//#define int long long
#define rep(i, a, b) for (int i = (a), i##end = (b); i <= i##end; ++i)
#define per(i, a, b) for (int i = (a), i##end = (b); i >= i##end; --i)
#define pii pair<int,int>
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define vi vector<int>
#define all(x) (x).begin() , (x).end()
#define mem( a ) memset( a , 0 , sizeof a )
#define int unsigned
typedef long long ll;
int n , d , P , op;
int A[MAXN];
int C[MAXN][MAXN] , dp[MAXN][MAXN] , S[MAXN];
void solve() {
	cin >> n >> d >> P;
	C[0][0] = 1;
	rep( i , 1 , n ) {
		C[i][0] = 1;
		rep( j , 1 , i ) C[i][j] = ( C[i - 1][j] + C[i - 1][j - 1] ) % P;
	}
	dp[1][0] = 1; S[1] = 1;
	rep( i , 2 , n ) {
		rep( k , 1 , i - 1 ) {
			rep( j , 1 , i ) {
				dp[i][j] = ( dp[i][j] + dp[i - k][j - 1] * 1ll * S[k] % P * C[i - 2][k - 1] ) % P;
			}
		}
		rep( j , 0 , d - 1 ) S[i] = ( S[i] + dp[i][j] ) % P;
	}
	int as = 0;
	rep( i , 1 , n ) rep( j , 0 , d ) rep( k , 0 , d ) if( j + k <= d ) as = ( as + dp[i][j] * 1ll * dp[n - i + 1][k] ) % P;
	rep( i , 1 , n ) rep( j , 0 , d - 1 ) rep( k , 0 , d - 1 ) as = ( as + P - dp[i][j] * 1ll * dp[n - i][k] % P ) % P;
	cout << as * 2ll * n % P * ( n - 1 ) % P << endl;
}

signed main() {
//    int T;cin >> T;while( T-- ) solve();
    solve();
}

#include<bits/stdc++.h>
using namespace std;
#define fu(a,b,c) for(int a=b;a<=c;a++)
#define fd(a,b,c) for(int a=b;a>=c;a--)
int read(){
	int ans=0,w=1;char c=getchar();
	while(!isdigit(c)&&c!='-')c=getchar();
	if(c=='-')w=-1,c=getchar();
	while(isdigit(c))ans=(ans<<1)+(ans<<3)+c-'0',c=getchar();
	return ans*w;
}
#define N 210
//#define Mod 98244353
#define LL long long
int n,d;
LL ans=0,Mod;
LL c[N][N],f[N][N],s[N][N];
void init(){
	fu(i,0,n){
		c[i][0]=1;
		fu(j,1,i)c[i][j]=(c[i-1][j]+c[i-1][j-1])%Mod;
	}
	fu(i,0,d)s[1][i]=1;
	f[1][0]=1;
}
int main(){
	n=read();d=read();Mod=read();
	init();
	fu(i,2,n){
		fu(j,1,i-1)
			fu(k,0,d-1)
				f[i][k+1]=(s[j][d-1]*c[i-2][j-1]%Mod*f[i-j][k]%Mod+f[i][k+1])%Mod;
		fu(j,1,d)s[i][j]=(s[i][j-1]+f[i][j])%Mod;
	}
	fu(i,0,n-1)
		fu(j,0,d)
			fu(k,0,d-j)if(k!=1)
				ans=(ans+f[i+1][j]*f[n-i][k]%Mod)%Mod;
	ans=2ll*n*(n-1)*ans%Mod;
	printf("%lld",ans);
	return 0;
}

#include<bits/stdc++.h>

#define fo(i,a,b) for(int i=a;i<=b;i++)
#define fd(i,a,b) for(int i=a;i>=b;i--)

using namespace std;

typedef long long LL;
typedef double db;

int get(){
	char ch;
	while(ch=getchar(),(ch<'0'||ch>'9')&&ch!='-');
	if (ch=='-'){
		int s=0;
		while(ch=getchar(),ch>='0'&&ch<='9')s=s*10+ch-'0';
		return -s;
	}
	int s=ch-'0';
	while(ch=getchar(),ch>='0'&&ch<='9')s=s*10+ch-'0';
	return s;
}

const int N = 205;

int n,d,mo;
LL f[N],g[N][N],h[N][N],t[N];

LL add(LL x,LL y){return x+y>=mo?x+y-mo:x+y;}
LL dec(LL x,LL y){return x<y?x-y+mo:x-y;}

LL c[N][N];

int main(){
	n=get();d=get();mo=get();
	c[0][0]=1;
	fo(i,1,n){
		c[i][0]=1;
		fo(j,1,i)c[i][j]=add(c[i-1][j-1],c[i-1][j]);
	}
	g[0][0]=1;
	fo(i,1,n){
		fo(x,0,d)f[i]=add(f[i],g[x][i-1]);
		t[i]=dec(f[i],g[d][i-1]);
		fo(x,1,d){
			//g[x][i]
			fo(s,1,i)
			if (g[x-1][i-s])g[x][i]=(g[x][i]+g[x-1][i-s]*c[i-1][s-1]%mo*t[s]%mo)%mo;
		}
	}
	LL ans1=0,ans2=0;
	fo(d1,0,d)
		fo(d2,0,d-d1)
			fo(i,0,n-1)
			ans1=(ans1+g[d1][i]*g[d2][n-1-i])%mo;
	fo(i,1,n-1)ans2=(ans2+t[i]*t[n-i])%mo;
	LL ans=dec(ans1,ans2)*(n*(n-1)*2)%mo;
	cout<<ans<<endl;
	return 0;
}

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<vector>
#include<queue>
#include<set>
//#define ls (rt<<1)
//#define rs (rt<<1|1)
#define vi vector<int>
#define pb push_back
#define mk make_pair
#define pii pair<int,int>
#define rep(i,a,b) for(int i=(a),i##end=(b);i<=i##end;i++)
#define fi first
#define se second
#define mod m
typedef long long ll;
using namespace std;
const int maxn=205;
int c[maxn][maxn];
int dp[maxn][maxn],sum[maxn];
int main(){
	//freopen("in","r",stdin);
    int n,d,m,ty;scanf("%d%d%d",&n,&d,&m);
   // cout<<n<<' '<<d<<' '<<m<<' '<<ty<<endl;
    rep(i,0,maxn-1){
    	c[0][i]=1;
    	rep(j,1,i)c[j][i]=(1ll*c[j-1][i-1]+c[j][i-1])%mod;
	}
	dp[1][0]=1,sum[1]=1;
	rep(i,2,n){rep(j,1,d)
		rep(k,1,i-1){
			dp[i][j]=(dp[i][j]+1ll*dp[i-k][j-1]*sum[k]%mod*c[k-1][i-2]%mod)%mod;
		}
		rep(u,0,d-1)sum[i]=(1ll*sum[i]+dp[i][u])%mod;
	}
	int ans=0;
	rep(i,1,n){
		rep(j,0,d)for(int k=0;j+k<=d;k++){
			ans=(ans+1ll*dp[i][j]*dp[n-i+1][k])%mod;
		}
	}
	rep(i,1,n)rep(j,0,d-1)rep(k,0,d-1){
		ans=(ans-1ll*dp[i][j]*dp[n-i][k])%mod;
	}
	ans=(1ll*ans%mod+mod)%mod;
	printf("%d",2ll * ((n * 1ll * (n - 1)) % m) % m * ans % m);
    return 0;
}

#include<cstdio>
#include<cmath>
#include<algorithm>
#include<cstdlib>
#include<cstring>
using namespace std;
inline int read()
{
	int x=0,f=1;char ch=getchar();
	while(ch<'0' || ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0' && ch<='9')x=x*10+ch-'0',ch=getchar();
	return x*f;
}
int stack[20];
inline void write(int x)
{
	if(x<0){putchar('-');x=-x;}
	if(!x){putchar('0');return;}
	int top=0;
	while(x)stack[++top]=x%10,x/=10;
	while(top)putchar(stack[top--]+'0');
}
inline void pr1(int x){write(x),putchar(' ');}
inline void pr2(int x){write(x),puts("");}
int mod;
inline int ad(long long x){return x>=mod?x-mod:x;}
inline int dec(long long x){return x<0?x+mod:x;}
long long g[210],f[210][210],C[210][210];
int main()
{
    //freopen("a.in","r",stdin);
    //freopen("a.out","w",stdout);
    int n=read(),d=read();mod=read();
	for(int i=0;i<=n;i++)
    {
    	C[i][0]=1;
    	for(int j=1;j<=i;j++)C[i][j]=ad(C[i-1][j]+C[i-1][j-1]);
    }
    if(d==1)
    {
    	if(n>2)pr2(0);
    	else pr2(4%mod);
    	return 0;
    }
    f[1][0]=g[1]=1;
    for(int i=2;i<=n;i++)
    {
    	for(int j=1;j<min(d+1,i);j++)
    	{
    		for(int k=1;k<i;k++)f[i][j]=ad(f[i][j]+1LL*f[i-k][j-1]*g[k]%mod*C[i-2][k-1]%mod);
    		if(j<d)g[i]=ad(g[i]+f[i][j]);
    	}
    }
    for(int i=2;i<=n;i++)f[i][0]=1;
    long long ans=0;
    for(int i=1;i<=n;i++)
    {
    	for(int j=1;j<=n-i;j++)ans=ad(ans+1LL*dec(g[i]-f[i][1])*dec(g[j]-f[j][1])%mod);
    	for(int j=0;j<=d;j++)
    	{
    		if(j==1 || (i!=1 && j==0))continue;
    		for(int k=0;k<=d-j;k++)
    		{
    			if(k==1 || (i!=n && k==0))continue;
    			ans=ad(ans+1LL*f[i][j]*f[n+1-i][k]%mod);
    		}
    	}
    }
    pr2(ad(1LL*ans*n%mod*(n-1)%mod*2));
    return 0;
}

#include<cstdio>
#include<algorithm>
#include<cstring>
#define LL long long
using namespace std;
const int N=205;
int n,d,mod;
LL ans,sum[N],c[N][N],f[N][N];
int main()
{
	scanf("%d%d%d",&n,&d,&mod);
	for(int i=0;i<=n;i++)c[i][0]=1;
	for(int i=1;i<=n;i++)
		for(int j=1;j<=i;j++)
			c[i][j]=(c[i-1][j]+c[i-1][j-1])%mod;
	sum[1]=1;f[1][0]=1;
	for(int i=2;i<=n;i++)
	{
		for(int j=1;j<=d;j++)
			for(int k=1;k<i;k++)
				f[i][j]=(f[i][j]+f[i-k][j-1]*sum[k]%mod*c[i-2][k-1]%mod)%mod;
		for(int j=1;j<=d-1;j++)
			sum[i]=(sum[i]+f[i][j])%mod;
	}
	for(int i=0;i<=n-1;i++)
		for(int j=0;j<=d;j++)
			for(int k=0;j+k<=d;k++)
				if(k!=1)ans=(ans+f[i+1][j]*f[n-i][k]%mod)%mod;
	printf("%lld",2*n*(n-1)*ans%mod);
	return 0;
}

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

const int N = 205;

#define ll long long

void exgcd(int a, int b, int& x, int& y) {
	if (!b) {
		x = 1, y = 0;
	} else {
		exgcd(b, a % b, y, x);
		y -= (a / b) * x;
	}
}

int inv(int a, int n) {
	int x, y;
	exgcd(a, n, x, y);
	return (x < 0) ? (x + n) : (x);
}

int Mod;

typedef class Z {
	public:
		int v;

		Z() : v(0) {	}
		Z(int x) : v(x){	}
		Z(ll x) : v(x % Mod) {	}

		friend Z operator + (const Z& a, const Z& b) {
			return (ll) a.v + b.v;
		}
		friend Z operator - (const Z& a, const Z& b) {
			return (ll) a.v - b.v;
		}
		friend Z operator * (const Z& a, const Z& b) {
			return Z(a.v * 1ll * b.v);
		}
		friend Z operator ~(const Z& a) {
			return inv(a.v, Mod);
		}
		friend Z operator - (const Z& a) {
			return Z(0) - a;
		}
		Z& operator += (Z b) {
			return *this = *this + b;
		}
		Z& operator -= (Z b) {
			return *this = *this - b;
		}
		Z& operator *= (Z b) {
			return *this = *this * b;
		}
		friend boolean operator == (const Z& a, const Z& b) {
			return a.v == b.v;
		}
} Z;

typedef Z Zi;

int n, d;
Zi comb[N][N];
Zi f[N][N], g[N];

int main(){
	scanf("%d%d%d", &n, &d, &Mod);
	if (Mod == 1) {
		puts("0");
		return 0;
	}
	comb[0][0] = 1;
	for (int i = 1; i <= n; i++) {
		comb[i][0] = comb[i][i] = 1;
		for (int j = 1; j < i; j++) {
			comb[i][j] = comb[i - 1][j - 1] + comb[i - 1][j];
		}
	}

	f[1][0] = 1, g[1] = 1;
	for (int i = 2; i <= n; i++) {
		for (int j = 1; j <= d; j++) {
			for (int k = 1; k < i; k++) {
				f[i][j] += f[i - k][j - 1] * g[k] * comb[i - 2][k - 1];
			}
			if (j < d)
				g[i] += f[i][j];
		}
	}

	Zi ans = 0;
	for (int i = 1; i <= n; i++) {
		for (int x = 0; x <= d; x++) {
			for (int y = 0; x + y <= d; y++) {
				if (y == 1) {
					continue;
				}
				ans += f[i][x] * f[n - i + 1][y];
			}
		}
	}
	ans = ans * n * (n - 1) * 2;
	printf("%d\n", ans.v);
	return 0;
}

#include<bits/stdc++.h>
#define ll long long
#define ull unsigned ll
#define uint unsigned
#define pii pair<int,int>
#define pll pair<ll,ll>
#define IT iterator
#define PB push_back
#define fi first
#define se second
#define For(i,j,k) for (int i=(int)(j);i<=(int)(k);i++)
#define Rep(i,j,k) for (int i=(int)(j);i>=(int)(k);i--)
#define CLR(a,v) memset(a,v,sizeof(a));
#define CPY(a,b) memcpy(a,b,sizeof(a));
#define debug puts("wzpakking")
#define y1 ysghysgsygsh
using namespace std;
const int N=205;
int n,d,mo,ans,tr[N];
int C[N][N],f[N][N];
int main(){
	scanf("%d%d%d",&n,&d,&mo);
	For(i,0,n) C[i][0]=1%mo;
	For(i,1,n) For(j,1,i)
		C[i][j]=(1ll*C[i-1][j]+C[i-1][j-1])%mo;
	f[1][0]=1;
	For(i,1,n){
		int S=0; tr[0]=1;
		For(j,0,d-1) S=(1ll*S+f[i][j])%mo;
		For(j,1,min(n/i,d)) tr[j]=1ll*tr[j-1]*C[i*j-1][i-1]%mo*S%mo;
		Rep(j,n,0) For(k1,1,min(n/i,d)) For(k2,0,d-k1)
			f[j][k1+k2]=(f[j][k1+k2]+1ll*f[j-k1*i][k2]*tr[k1]%mo*C[j-1][k1*i])%mo;
	}
	For(i,0,n-1) For(j,0,d) For(k,0,d-j)
		if (k!=1) ans=(ans+1ll*f[i+1][j]*f[n-i][k])%mo;
	printf("%d\n",2ll*n*(n-1)*ans%mo);
}//hello

#include<bits/stdc++.h>
#define ll long long
#define ull unsigned ll
#define uint unsigned
#define pii pair<int,int>
#define pll pair<ll,ll>
#define IT iterator
#define PB push_back
#define fi first
#define se second
#define For(i,j,k) for (int i=(int)(j);i<=(int)(k);i++)
#define Rep(i,j,k) for (int i=(int)(j);i>=(int)(k);i--)
#define CLR(a,v) memset(a,v,sizeof(a));
#define CPY(a,b) memcpy(a,b,sizeof(a));
#define debug puts("wzpakking")
#define y1 ysghysgsygsh
using namespace std;
const int N=205;
int n,d,mo,ans,tr[N];
int C[N][N],f[N][N];
int main(){
	scanf("%d%d%d",&n,&d,&mo);
	For(i,0,n) C[i][0]=1%mo;
	For(i,1,n) For(j,1,i)
		C[i][j]=(1ll*C[i-1][j]+C[i-1][j-1])%mo;
	f[1][0]=1;
	For(i,1,n){
		int S=0; tr[0]=1;
		For(j,0,d-1) S=(1ll*S+f[i][j])%mo;
		For(j,1,min(n/i,d)) tr[j]=1ll*tr[j-1]*C[i*j-1][i-1]%mo*S%mo;
		Rep(j,n,0) For(k1,1,min(n/i,d)) For(k2,0,d-k1)
			f[j][k1+k2]=(f[j][k1+k2]+1ll*f[j-k1*i][k2]*tr[k1]%mo*C[j-1][k1*i])%mo;
	}
	For(i,0,n-1) For(j,0,d) For(k,0,d-j)
		if (k!=1) ans=(ans+1ll*f[i+1][j]*f[n-i][k])%mo;
	printf("%d\n",2ll*n*(n-1)*ans%mo);
}

#include<bits/stdc++.h>
int mod;
typedef long long ll;
ll gi(){
	ll x=0,f=1;
	char ch=getchar();
	while(!isdigit(ch))f^=ch=='-',ch=getchar();
	while(isdigit(ch))x=x*10+ch-'0',ch=getchar();
	return f?x:-x;
}
unsigned f[210][210],sf[210],C[210][210];
int main(){
	int n,d;std::cin>>n>>d>>mod;
	C[0][0]=1;for(int i=1;i<=n;++i){
		C[i][0]=1;
		for(int j=1;j<=i;++j)C[i][j]=(C[i-1][j]+C[i-1][j-1])%mod;
	}
	f[1][0]=sf[1]=1;
	for(int i=2;i<=n;++i)
		for(int j=1;j<=d;++j){
			for(int k=1;k<i;++k)f[i][j]=(f[i][j]+1ll*f[i-k][j-1]*sf[k]%mod*C[i-2][k-1])%mod;
			if(j<d)sf[i]=(sf[i]+f[i][j])%mod;
		}
	int ans=0;
	for(int i=1;i<=n;++i)
		for(int j=0;j<=d;++j)
			for(int k=0;k<=d-j;++k)
				if(k!=1)ans=(ans+1ll*f[i][j]*f[n-i+1][k])%mod;
	printf("%d\n",2ll*n*(n-1)*ans%mod);
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef bool boolean;
#define ll long long

const int N = 205;

int n, d, M;
int C[N][N], f[N][N], sum[N][N];

int add(int a, int b) {
	ll x = (ll) a + b;
	if (x >= M)
		return x - M;
	return x;
}

inline void init() {
	scanf("%d%d%d", &n, &d, &M);
}

inline void solve() {
	C[0][0] = 1;
	for (int i = 1; i <= n; i++) {
		C[i][0] = C[i][i] = 1;
		for (int j = 1; j < i; j++)
			C[i][j] = add(C[i - 1][j - 1], C[i - 1][j]);
	}

	f[1][0] = 1;
	for (int i = 0; i <= d; i++)
		sum[1][i] = 1;
	for (int i = 2; i <= n; i++) {
		for (int j = 1; j < i && j <= d; j++)
			for (int k = 1; k < i; k++)
				f[i][j] = add(f[i][j], sum[k][d - 1] * 1ll * C[i - 2][k - 1] % M * f[i - k][j - 1] % M);
		sum[i][0] = f[i][0];
		for (int j = 1; j <= d; j++)
			sum[i][j] = add(f[i][j], sum[i][j - 1]);
	}

	int ans = 0;
	for (int i = 1; i <= n; i++)
		for (int j = 0; j <= d && j < i; j++)
			for (int k = 0; j + k <= d; k++)
				if (k ^ 1)
					ans = add(ans, f[i][j] * 1ll * f[n - i + 1][k] % M);
	printf("%d\n", ans * 2ll * n * (n - 1) % M);
}

int main() {
	init();
	solve();
	return 0;
}

#include<iostream>
#include<vector>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<ctime>
#include<queue>
#include<set>
#include<map>
#include<stack>
#include<bitset>

#define pb push_back
#define mp make_pair

using namespace std;

template<typename T>inline void upmin(T &x,T y) { y<x?x=y:0; }
template<typename T>inline void upmax(T &x,T y) { x<y?x=y:0; }

typedef unsigned int u32;
typedef long long LL;
typedef unsigned long long ULL;
typedef long double lod;
typedef pair<int,int> PR;
typedef vector<int> VI;

const lod pi=acos(-1);
const int oo=1<<30;
const LL OO=1e18;

const int N=210;

int gi() {
	int w=0;bool q=1;char c=getchar();
	while ((c<'0'||c>'9') && c!='-') c=getchar();
	if (c=='-') q=0,c=getchar();
	while (c>='0'&&c <= '9') w=w*10+c-'0',c=getchar();
	return q? w:-w;
}

LL f[N][N],g[N],C[N][N];
int main()
{
#ifndef ONLINE_JUDGE
	freopen("H.in","r",stdin);
	freopen("H.out","w",stdout);
#endif
	int n=gi(),d=gi(),mod=gi(),i,j,k;LL ans=0;
	for (i=0;i<=n;i++)
		for (j=C[i][0]=1;j<=i;j++)
			C[i][j]=(C[i-1][j]+C[i-1][j-1])%mod;
	f[1][0]=g[1]=1;
	for (i=2;i<=n;i++) {
		for (j=1;j<=d;j++)
			for (k=1;k<i;k++)
				f[i][j]=(f[i][j]+f[i-k][j-1]*C[i-2][k-1]%mod*g[k])%mod;
		for (j=1;j<d;j++)
			(g[i]+=f[i][j])%=mod;
	}
	for (i=0;i<=d;i++)
		for (j=0;i+j<=d;j++)
			if (j!=1)
				for (k=1;k<=n;k++)
					ans=(ans+f[k][i]*f[n-k+1][j])%mod;
	//if (n==2||d>1) ans-=n-1;
	//if (ans<0) ans+=mod;
	ans=ans*2*n*(n-1)%mod;
	cout<<ans<<endl;
	return 0;
}

#include <cstdio>

typedef long long ll;

const int N=205;
int n,d,mod; ll c[N][N],f[N][N],g[N],ans;
inline ll fix(ll x){ return x>=mod?x-mod:x; }

int main(){
	scanf("%d%d%d",&n,&d,&mod);
	for(int i=0;i<=n;++i){
		c[i][0]=1;
		for(int j=1;j<=i;++j) c[i][j]=fix(c[i-1][j-1]+c[i-1][j]);
	}
	f[1][0]=g[1]=1;
	for(int i=2;i<=n;++i){
		for(int k=1;k<=d;++k) for(int j=1;j<=i-1;++j){
			f[i][k]=(f[i][k]+1ll*f[i-j][k-1]*c[i-2][j-1]%mod*g[j])%mod;
		}
		for(int j=1;j<=d-1;++j) g[i]=fix(g[i]+f[i][j]);
	}
	for(int i=0;i<=n-1;++i){
		for(int j=0;j<=d;++j) for(int k=0;j+k<=d;++k){
			if(k^1) ans=(ans+1ll*f[i+1][j]*f[n-i][k])%mod;
		}
	}
	ans=2ll*n*(n-1)*ans%mod; return printf("%lld\n",ans),0;
}

//starusc
#include<bits/stdc++.h>
using namespace std;
#define int long long
inline int read(){
	int x=0,f=1;char c=getchar();
	while(!isdigit(c)){if(c=='-')f=-1;c=getchar();}
	while(isdigit(c)){x=(x<<1)+(x<<3)+(c^48);c=getchar();}
	return f==1?x:-x;
}
const int N=204;
int n,d,ans,mod,c[N][N],f[N][N],sum[N];
signed main(){
	n=read();d=read();mod=read();
	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;
	}
	f[1][0]=sum[1]=1;
	for(int i=2;i<=n;i++){
		for(int j=1;j<=min(i,d);j++){
			for(int k=1;k<i;k++){
				f[i][j]=(f[i-k][j-1]*sum[k]%mod*c[i-2][k-1]%mod+f[i][j])%mod;
			}
			if(j!=d)sum[i]=(f[i][j]+sum[i])%mod;//
		}
	}
	for(int i=1;i<=n;i++){
		for(int u=0;u<=d;u++){
			for(int v=0;u+v<=d;v++)if(v!=1){//
				ans=(f[i][u]*f[n-i+1][v]+ans)%mod;
			}
		}
	}
	cout<<ans*n%mod*(n-1)%mod*2%mod;
	return (0-0);
}

#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <queue>
//#define ivorysi
using namespace std;
typedef long long ll;
int n,d;
ll tree[205][205][205];
ll c[205][205],mod;
int main() {
#ifdef ivorysi
	freopen("f1.in","r",stdin);
#endif
	scanf("%d%d%lld",&n,&d,&mod);
	for(int i = 0 ; i <= n ; ++i) c[i][0] = 1;
	for(int i = 1 ; i <= n ; ++i) {
		for(int j = 1 ; j <= i ; ++j) {
			c[i][j] = c[i - 1][j] + c[i - 1][j - 1];
			c[i][j] %= mod;
		}
	}
	tree[1][1][0] = 1;
	for(int i = 1 ; i < n ; ++i) {
		for(int j = 1 ; j <= n ; ++j) {
			for(int k = 0 ; k <= d ; ++k) {
				tree[i + 1][j][k] = tree[i][j][k];
			}
		}
		ll tree_i = 0;
		for(int j = 0 ; j < d ; ++j) {
			tree_i += tree[i][i][j];
			tree_i %= mod;
		}
		ll ways = 1;
		for(int j = 1 ; j <= d  && i * j <= n; ++j) {
			ways = (ways * c[i * j - 1][i - 1]) % mod;
			for(int k = 1 ; k + i * j <= n ; ++k) {
				ll cc = ways * c[i * j + k - 1][k - 1] % mod;
				for(int h = 0 ; h + j <= d ; ++h) {
					tree[i + 1][i * j + k][h + j] += tree[i][k][h] * tree_i % mod * cc % mod;
					tree[i + 1][i * j + k][h + j] %= mod;
				}
			}
			ways = ways * tree_i % mod;
		}
	}
	ll tot_tr = 0;
	for(int i = 0 ; i <= n - 1 ; ++i) {
		for(int j = 0 ; j <= d ; ++j) {
			for(int k = 0 ; k + j<= d ; ++k) {
				if(k == 1) {
					continue;
				}
				tot_tr += tree[n][i + 1][j] * tree[n][n - i][k] % mod;
				tot_tr %= mod;
			}
		}
	}
	ll ans = 1LL * 2 * n * (n - 1) % mod * tot_tr % mod;
	printf("%lld\n",ans);
	return 0;
}

#include<bits/stdc++.h>
#define For(i,j,k) for (int i=j;i<=k;i++)
#define int long long
using namespace std;
#define N 205
int c[N][N],tr[N][N][N];
int mo,n,d;
signed main(){
	scanf("%lld%lld%lld",&n,&d,&mo);
	For(i,0,n){
		c[i][0]=1;
		For(j,1,i)
			c[i][j]=(c[i-1][j]+c[i-1][j-1])%mo;
	}
	tr[1][1][0]=1;
	/*tr[i][j][k]:已经加到i的树，有j个节点，根节点为k而且根到其他节点路径单调的方案数*/
	For(i,1,n-1){
		For(j,1,n) For(k,0,d)
			tr[i+1][j][k]=tr[i][j][k];
		int tri=0;
		For(j,0,d-1) tri=(tri+tr[i][i][j])%mo;
		int ways=1;
		For(j,1,min(n/i,d)){//选择j个
			ways=1ll*ways*c[i*j-1][i-1]%mo;
			For(k,1,n-i*j){//加到k上
				int cnt=1ll*ways*c[k+i*j-1][k-1]%mo;
				For(deg,0,d-j)
					tr[i+1][k+i*j][deg+j]=(tr[i+1][k+i*j][deg+j]+1ll*cnt*tr[i][k][deg]%mo*tri%mo)%mo;
			}
			ways=1ll*ways*tri%mo;
		}
	}
	int ans=0;
	For(i,0,n-1) For(j,0,d) For(k,0,d-j)
		if (k!=1) ans=(ans+1ll*tr[n][i+1][j]*tr[n][n-i][k])%mo;
	printf("%lld\n",2ll*n*(n-1)%mo*ans%mo);
}

//Zory-2020
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
// typedef __int128 ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define FR first
#define SE second
#define MP make_pair
#define PB push_back
#define vc vector
#define db double
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define bin(x) (1ll<<(x))
#define fo(i,l,r) for(int i=(l),I=(r);i<=I;i++)
#define fd(i,r,l) for(int i=(r),I=(l);i>=I;i--)
#define mem(x,val) memset(x,val,sizeof x)
#define Swap(a,b,n) for(int I=0;I<=n;I++) swap(a[I],b[I])
#define PC __builtin_popcountll
#ifdef DEBUG
	#define debug(A,args...) fprintf(stderr,A,##args)
#else
	#define debug(A,args...)
#endif
#define deb debug("line %d\n",__LINE__)
namespace mine
{
	ll qread()
	{
		ll ans=0,f=1;char c=getchar();
		while(c<'0' or c>'9') {if(c=='-')f=-1;c=getchar();}
		while('0'<=c and c<='9') ans=ans*10+c-'0',c=getchar();
		return ans*f;
	}
	void write(ll num){if(num<0) putchar('-'),num=-num;if(num>=10) write(num/10);putchar('0'+num%10);}
	void write1(ll num){write(num);putchar(' ');}
	void write2(ll num){write(num);putchar('\n');}
	template<typename T>inline bool chmax(T&a,const T&b){return a<b?a=b,1:0;}
	template<typename T>inline bool chmin(T&a,const T&b){return a>b?a=b,1:0;}
	ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}
	bool IN(ll x,ll l,ll r){return l<=x and x<=r;}
	void GG(){puts("No");exit(0);}

	const db eps=1e-8;
	const int INF=0x3f3f3f3f;
	const int MOD=998244353;
	int mm(const int x){return x>=MOD?x-MOD:x;}
	template<typename T> void add(T &x,const int &y){x=(x+y>=MOD?x+y-MOD:x+y);}
	ll qpower(ll x,ll e,int mod=MOD){ll ans=1;while(e){if(e&1)ans=ans*x%mod;x=x*x%mod;e>>=1;}return ans;}
	ll invm(ll x){return qpower(x,MOD-2);}
	//const int MM=1e6+10;
	//ll fac[MM],facinv[MM],Inv[MM];ll C(int n,int m){return n<0 or m<0 or n<m?0:fac[n]*facinv[m]%MOD*facinv[n-m]%MOD;}
	//void PRE()
	//{
	//	fac[0]=1;fo(i,1,MM-1) fac[i]=fac[i-1]*i%MOD;
	//	facinv[MM-1]=invm(fac[MM-1]);fd(i,MM-1,1) facinv[i-1]=facinv[i]*i%MOD;
	//	Inv[1]=1;fo(i,2,MM-1) Inv[i]=(MOD-MOD/i)*Inv[MOD%i]%MOD;
	//}

	const int N=1e3+10;
	//------------------FIXED------------------
	ll C[N][N];
	ll f[N],dp[N][N];//f(siz),dp(siz,deg)
	void main()
	{
		int n=qread(),D=qread(),mod=qread();
		//if(!qread()){ write(mod==1 or (D==1 and n!=2)?0:1);return; }
		C[0][0]=1;fo(i,1,n){ C[i][0]=1;fo(j,1,i) C[i][j]=(C[i-1][j-1]+C[i-1][j])%mod; }
		dp[1][0]=f[1]=1;
		fo(siz,2,n) fo(d,1,D)
		{
			fo(lst,1,siz-1) if(f[lst] and dp[siz-lst][d-1])
				(dp[siz][d]+=dp[siz-lst][d-1]*f[lst]%mod*C[siz-2][lst-1] )%=mod;
			if(d<=D-(siz!=n)) (f[siz]+=dp[siz][d])%=mod;
		}
		ll ans=(f[n]+mod-dp[n][1])*2%mod;
		fo(s,1,n-1) fo(d1,2,D) fo(d2,2,D) if(d1+d2<=D) (ans+=dp[s][d1]*dp[n-s+1][d2])%=mod;
		fo(s,1,n-1) fo(d,0,D-1) if(d!=1) (ans+=dp[s][d]*dp[n-s+1][1])%=mod;//*(1/2)*2
		ans=ans*(n*(n-1)/2)%mod*4%mod;
		write((ans+mod)%mod);
	}
};//变量重名！
signed main()
{
	#ifdef DEBUG
	freopen("a.in","r",stdin);
	//freopen("a.out","w",stdout);
	#endif
	mine::main();
	debug("\n---------------------Zory---------------------\nTime: %.2lf s",1.0*clock()/CLOCKS_PER_SEC);
}

#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
#include <cmath>
#include <set>
#include <map>
#include <cstdio>
#include <stdlib.h>
#include <stack>
#include <numeric>
#include <bitset>
#include <cctype>
#include <list>
#include <assert.h>
#include <random>
#include <unordered_map>
#include <ctime>
typedef  long long ll;
using namespace std;
#define INF 2147483647
#define infL (1LL<<60)
#define inf (1<<30)
#define inf9 (1000000000)
#define MOD 1000000007
#define EPS 1e-9
#define Gr 9.8
#define PI acos(-1)
#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define REQ(i,n) for(int (i)=1;(i)<=(int)(n);(i)++)
#define lch (rt<<1)
#define rch (rt<<1|1)
#define readmp(n) for(int i=0,u,v;i<n;i++) {scanf("%d%d",&u,&v); mp[u].push_back(v); mp[v].push_back(u);}
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef long double ld;
typedef unsigned int uint;
#define MAX 205
bool debug = 0;
int n,m,k;
int dx[4] = {0,1,0,-1}, dy[4] = {1,0,-1,0};
string direc="RDLU";
ll ln, lk, lm;
void etp(bool f = 0) {
    puts(f ?"YES" : "NO");
    exit(0);
}
void addmod(int &x, int y, int mod = MOD) {
    assert(y>=0);
    x+=y; if (x>=mod) x-=mod;
    assert(x>=0 && x<mod);
}
void et() {
    puts("-1"); exit(0);
}
ll fastPow(ll x, ll y, int mod=MOD) {
    ll ans = 1;
    while(y>0) {
        if(y&1) ans = (x * ans)%mod;
        x = x*x%mod;
        y>>=1;
    }
    return ans;
}
ll gcd1(ll x, ll y) {
    ll z = y;
    while(x%y!=0) {
        z = x%y; x = y; y = z;
    }
    return z;
}

int d;
ll f[MAX][MAX], C[MAX][MAX], ss[MAX];
void comb(int n) {
    C[0][0] = 1;
    for (int i = 1; i <= n; i++) {
        C[i][0] = C[i][i] = 1;
        for (int j = 1; j < i; j++) {
            C[i][j] = (ll)(C[i - 1][j - 1] + C[i - 1][j]) % m;
        }
    }
}
void fmain(int ID) {
    scanf("%d%d%d", &n,  &d,&m);
    f[1][0]=1; ss[1]=1;
    comb(n);
    for(int i=2;i<=n;i++) {
        for(int j=1;j<=min(d,i-1);j++) {
            for(int k=1;k<i;k++) {
                f[i][j] += (ll)f[i-k][j-1] * C[i-2][k-1] % m * ss[k] % m;
                f[i][j]%=m;
            }
        }
        for(int j=1;j<d;j++) {
            ss[i]+=f[i][j]; ss[i]%=m;
        }
    }

    ll S=0;

    REQ(i,n) {
        for(int j=0;j<=d;j++) {
            for(int k=0;j+k<=d;k++) if(k!=1) {
                S+=(ll)f[i][j] * f[n-i+1][k] % m; S%=m;
            }
        }
    }

    int tn = (n-1)*n*2;
    int ans = (ll)S*tn%m;
    printf("%d\n", ans);
}

int main() {
    int t=1;
//    scanf("%d", &t);
    REQ(i,t) {
        fmain(i);
    }
    return 0;
}

#include <cstdio>
#define int long long

int n,d,P,f[210][210],g[210][210],F[210],C[210][210];
inline int mul(const int &a,const int &b){return 1ll*a*b%P;}
inline int add(int a,const int &b){a+=b;return(a>=P)?a-P:a;}
inline int sub(int a,const int &b){a-=b;return (a<0)?a+P:a;}
signed main(){
	scanf("%lld%lld%lld",&n,&d,&P);
	for(int i=0;i<=n;i++){
		C[i][0]=1;
		for(int j=1;j<=i;j++)
			C[i][j]=add(C[i-1][j],C[i-1][j-1]);
	}
	f[0][0]=1;
	for(int i=1;i<n;i++){
		for(int j=0;j<d;j++)F[i]=add(F[i],f[j][i-1]);
		for(int j=i;j;j--)
			for(int k=1;k<=i;k++)
				f[j][i]=add(f[j][i],mul(C[i-1][k-1],mul(f[j-1][i-k],F[k])));
	}
	int ans=0;
	for(int j=0;j<=d;j++)F[n]=add(F[n],f[j][n-1]);
	for(int i=0;i<n;i++)
		for(int j=0;j<=d;j++)
			for(int k=0;k+j<=d;k++)
				if(k!=1)ans=add(ans,mul(f[j][i],f[k][n-1-i]));
	printf("%lld",mul(ans,2ll*n%P*(n-1)%P));
}

#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")

#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/rope>

using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;

typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;

typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;

typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;

template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define F0R(i, a) for (int i = 0; i < (a); i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= (a); i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)
#define trav(a, x) for (auto& a : x)

#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound

#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)
#define rsz resize

int MOD = 1000000007; // 998244353
const ll INF = 1e18;
const int MX = 200005;
const ld PI = 4*atan((ld)1);

template<class T> void ckmin(T &a, T b) { a = min(a, b); }
template<class T> void ckmax(T &a, T b) { a = max(a, b); }

namespace input {
    template<class T> void re(complex<T>& x);
    template<class T1, class T2> void re(pair<T1,T2>& p);
    template<class T> void re(vector<T>& a);
    template<class T, size_t SZ> void re(array<T,SZ>& a);

    template<class T> void re(T& x) { cin >> x; }
    void re(double& x) { string t; re(t); x = stod(t); }
    void re(ld& x) { string t; re(t); x = stold(t); }
    template<class Arg, class... Args> void re(Arg& first, Args&... rest) {
        re(first); re(rest...);
    }

    template<class T> void re(complex<T>& x) { T a,b; re(a,b); x = cd(a,b); }
    template<class T1, class T2> void re(pair<T1,T2>& p) { re(p.f,p.s); }
    template<class T> void re(vector<T>& a) { F0R(i,sz(a)) re(a[i]); }
    template<class T, size_t SZ> void re(array<T,SZ>& a) { F0R(i,SZ) re(a[i]); }
}

using namespace input;

namespace output {
    template<class T1, class T2> void pr(const pair<T1,T2>& x);
    template<class T, size_t SZ> void pr(const array<T,SZ>& x);
    template<class T> void pr(const vector<T>& x);
    template<class T> void pr(const set<T>& x);
    template<class T1, class T2> void pr(const map<T1,T2>& x);

    template<class T> void pr(const T& x) { cout << x; }
    template<class Arg, class... Args> void pr(const Arg& first, const Args&... rest) {
        pr(first); pr(rest...);
    }

    template<class T1, class T2> void pr(const pair<T1,T2>& x) {
        pr("{",x.f,", ",x.s,"}");
    }
    template<class T> void prContain(const T& x) {
        pr("{");
        bool fst = 1; for (const auto& a: x) pr(!fst?", ":"",a), fst = 0; // const needed for vector<bool>
        pr("}");
    }
    template<class T, size_t SZ> void pr(const array<T,SZ>& x) { prContain(x); }
    template<class T> void pr(const vector<T>& x) { prContain(x); }
    template<class T> void pr(const set<T>& x) { prContain(x); }
    template<class T1, class T2> void pr(const map<T1,T2>& x) { prContain(x); }

    void ps() { pr("\n"); }
    template<class Arg> void ps(const Arg& first) {
        pr(first); ps(); // no space at end of line
    }
    template<class Arg, class... Args> void ps(const Arg& first, const Args&... rest) {
        pr(first," "); ps(rest...); // print w/ spaces
    }
}

using namespace output;

namespace io {
    void setIn(string s) { freopen(s.c_str(),"r",stdin); }
    void setOut(string s) { freopen(s.c_str(),"w",stdout); }
    void setIO(string s = "") {
        ios_base::sync_with_stdio(0); cin.tie(0); // fast I/O
        if (sz(s)) { setIn(s+".in"), setOut(s+".out"); } // for USACO
    }
}

using namespace io;

template<class T> T invGeneral(T a, T b) {
    a %= b; if (a == 0) return b == 1 ? 0 : -1;
    T x = invGeneral(b,a);
    return x == -1 ? -1 : ((1-(ll)b*x)/a+b)%b;
}

template<class T> struct modular {
    T val;
    explicit operator T() const { return val; }
    modular() { val = 0; }
    modular(const ll& v) {
        val = (-MOD <= v && v <= MOD) ? v : v % MOD;
        if (val < 0) val += MOD;
    }

    friend ostream& operator<<(ostream& os, const modular& a) { return os << a.val; }
    friend bool operator==(const modular& a, const modular& b) { return a.val == b.val; }
    friend bool operator!=(const modular& a, const modular& b) { return !(a == b); }
    friend bool operator<(const modular& a, const modular& b) { return a.val < b.val; }

    modular operator-() const { return modular(-val); }
    modular& operator+=(const modular& m) { if ((val += m.val) >= MOD) val -= MOD; return *this; }
    modular& operator-=(const modular& m) { if ((val -= m.val) < 0) val += MOD; return *this; }
    modular& operator*=(const modular& m) { val = (ll)val*m.val%MOD; return *this; }
    friend modular pow(modular a, ll p) {
        modular ans = 1; for (; p; p /= 2, a *= a) if (p&1) ans *= a;
        return ans;
    }
    friend modular inv(const modular& a) {
        auto i = invGeneral(a.val,MOD); assert(i != -1);
        return i;
    } // equivalent to return exp(b,MOD-2) if MOD is prime
    modular& operator/=(const modular& m) { return (*this) *= inv(m); }

    friend modular operator+(modular a, const modular& b) { return a += b; }
    friend modular operator-(modular a, const modular& b) { return a -= b; }
    friend modular operator*(modular a, const modular& b) { return a *= b; }

    friend modular operator/(modular a, const modular& b) { return a /= b; }
};

typedef modular<ll> mi;
typedef pair<mi,mi> pmi;
typedef vector<mi> vmi;
typedef vector<pmi> vpmi;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int n,d;
mi ans;
mi dp[201][201], comb[201][201];

void solve() {
	F0R(i,d+1) dp[1][i] = 1;
	FOR(a,2,n+1) FOR(b,1,d+1) FOR(k,1,a)
		dp[a][b] += comb[a-2][k-1]*dp[a-k][b-1]*dp[k][d-1]; // a vertices, at most b adj

	FOR(i,1,n+1) FOR(j,1,n+1-i)
		ans += (dp[i][d-1]-dp[i][1]+dp[i][0])*(dp[j][d-1]-dp[j][1]+dp[j][0]);
	FOR(i,1,n+1) {
		int j = n+1-i;
		F0R(a,d+1) F0R(b,d+1-a) {
			if (a == 1 || b == 1) continue;
			ans += (dp[i][a]-(a?dp[i][a-1]:0))*(dp[j][b]-(b?dp[j][b-1]:0));
		}
	}
}

int main() {
    setIO(); re(n,d,MOD);
	if (d == 1) {
		if (n == 2) ps(4%MOD);
		else ps(0);
		exit(0);
	}
    comb[0][0] = 1;
    FOR(i,1,n+1) F0R(j,i+1) {
    	comb[i][j] = comb[i-1][j];
    	if (j) comb[i][j] += comb[i-1][j-1];
    }
    solve();
    // ps("HUH",ans);
    ans *= 2*n*(n-1);
    ps(ans);
}

/* stuff you should look for
    * int overflow, array bounds
    * special cases (n=1?), set tle
    * do smth instead of nothing and stay organized
*/

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

const int N=211;
typedef long long ll;
int n,K,mod,ans,g[N],f[N][N],C[N][N];
inline void reduce(int&x){x+=x>>31&mod;}
int main(){
	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	cin>>n>>K>>mod;
	for(int i=0;i<=n;++i){
		C[i][0]=1;
		for(int j=1;j<=i;++j)reduce(C[i][j]=C[i-1][j]-mod+C[i-1][j-1]);
	}
	f[1][0]=1;g[1]=1;
	for(int i=2;i<=n;++i)
		for(int j=1;j<=K;++j){
			for(int k=1;k<i;++k)
				f[i][j]=(f[i][j]+(ll)f[k][j-1]*g[i-k]%mod*C[i-2][k-1])%mod;
			if(j!=K)reduce(g[i]+=f[i][j]-mod);
		}
	for(int i=1;i<=n;++i)
		for(int j=0;j<=K;++j)if(j!=1)
			for(int k=0;k<=K-j;++k)
				ans=(ans+(ll)f[i][j]*f[n+1-i][k])%mod;
	ans=(ll)2*n*(n-1)%mod*ans%mod;
	cout<<ans<<'\n';
	return 0;
}

#include<bits/stdc++.h>
const int N=210;
int n,d,mod,ans,C[N][N],dp[N][N],sum[N];
int main(){
#ifdef memset0
	freopen("1.in","r",stdin);
#endif
	scanf("%d%d%d",&n,&d,&mod);
	for(int i=0;i<=n;i++){
		C[i][0]=1;
		for(int j=1;j<=i;j++)C[i][j]=((long long)C[i-1][j-1]+C[i-1][j])%mod;
	}
	for(int i=1;i<=n;i++){
		if(i==1){
			dp[1][0]=1;
		}else{
			dp[i][1]=sum[i-1];
			for(int j=2;j<i&&j<=d;j++)
				for(int k=1;k<i;k++){
					dp[i][j]=(dp[i][j]+(long long)dp[k][j-1]*sum[i-k]%mod*C[i-2][k-1])%mod;
				}
		}
		for(int j=0;j<d;j++)sum[i]=((long long)sum[i]+dp[i][j])%mod;
	}
	// for(int i=1;i<=n;i++)
	// 	for(int j=0;j<=d;j++)
	// 		printf("%d%c",dp[i][j]," \n"[j==d]);
	for(int i=1;i<=n;i++)
		for(int j=0;j<=d;j++)
			for(int k=0;j+k<=d;k++){
				ans=(ans+(long long)dp[i][j]*dp[n-i+1][k])%mod;
			}
	for(int i=1;i<=n;i++)
		for(int j=0;j<d;j++)
			for(int k=0;k<d;k++){
				ans=(ans-(long long)dp[i][j]*dp[n-i][k])%mod;
			}
	ans=(long long)ans*n%mod*(n-1)%mod*2%mod;
	printf("%d\n",ans<0?ans+mod:ans);
}

// Phoenix

#include<bits/stdc++.h>

#define F first
#define S second
#define PB push_back
#define sz(s) int((s).size())
#define bit(n,k) (((n)>>(k))&1)

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

const int maxn=210;

ll dp[maxn][maxn],sm[maxn][maxn],C[maxn][maxn];// size akidan ziresh // darjeeash

int main(){
    ios_base::sync_with_stdio(false);cin.tie(0);
    ll n,d,m;cin>>n>>d>>m;

    if(d==1){
	if(n==2)
	    return cout<<4%m<<endl,0;
	else
	    return cout<<0<<endl,0;
    }
    C[0][0]=1;
    for(int i=1;i<maxn;i++){
	C[i][0]=1;
	for(int j=1;j<=i;j++){
	    C[i][j]=(C[i-1][j]+C[i-1][j-1])%m;
	}
    }

    dp[0][0]=sm[0][0]=1;
    for(int j=1;j<=d;j++){
	sm[0][j]=1;
    }
    for(int i=1;i<maxn;i++){
	for(int j=1;j<=d;j++){
	    for(int k=1;k<=i;k++){
		dp[i][j]=(dp[i][j]+dp[i-k][j-1]*sm[k-1][d-1] %m *C[i-1][k-1]) %m;
	    }
	    sm[i][j]=(sm[i][j-1]+dp[i][j])%m;
	}
    }

    ll ans=0;
    for(int i=0;i<n;i++){
	for(int j=0;(j+i)<n-1;j++){
	    ans=(ans+(sm[i][d-1]-dp[i][1])*(sm[j][d-1]-dp[j][1]))%m;
	}
    }
    for(int i=0;i<n;i++){
	for(int dg=0;dg<=d;dg++){
	    if(dg==1) continue;
	    ans=(ans+dp[i][dg]*sm[n-1-i][d-dg])%m;
	    if(d-dg>=1)
		ans=(ans-dp[i][dg]*dp[n-1-i][1])%m;
	}
    }
    ans=ans*2*n*(n-1) %m;
    if(ans<0) ans+=m;
    cout<<ans<<endl;
    return 0;
}

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

using u64 = unsigned long long;
using u32 = unsigned;

const int MaxN = 200;
const int MaxD = MaxN - 1;

int n, d;
u32 m;

u32 f[MaxN + 1][MaxD + 1];
u32 g[MaxN + 1][MaxD + 1];

u32 bin[MaxN + 1][MaxN + 1];

int main()
{
	cin >> n >> d >> m;

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

	f[1][0] = 1;
	for (int i = 0; i <= d; ++i)
		g[1][i] = 1;

	for (int i = 2; i <= n; ++i)
	{
		for (int j = 1; j <= d; ++j)
			for (int k = 1; k < i; ++k)
				f[i][j] = (f[i][j] + (u64)bin[i - 2][k - 1] * f[i - k][j - 1] % m * g[k][d - 1]) % m;

		for (int j = 1; j <= d; ++j)
			g[i][j] = (g[i][j - 1] + f[i][j]) % m;
	}

	u32 res = 0;
	for (int i = 0; i < n; ++i)
		for (int j = 0; j <= d; ++j)
			for (int k = 0; j + k <= d; ++k)
				if (k != 1)
					res = (res + (u64)f[i + 1][j] * f[n - i][k]) % m;

	cout << 2ull * n * (n - 1) % m * res % m << endl;

	return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define MAXN 205
#define INF 0x3f3f3f3f
#define FIO "we"
#define ll long long
template <class T>
inline void read(T &x)
{
	T f=1;x=0;
	char ch=getchar();
	for (;!isdigit(ch) && ch!='-';ch=getchar());
	if (ch=='-')	ch=getchar(),f=-1;
	for (;isdigit(ch);ch=getchar())	x=x*10+ch-'0';
	x*=f;
}
ll ans,D,MOD,N,c[MAXN][MAXN],f[MAXN][MAXN],s[MAXN][MAXN];
int main()
{
	read(N);read(D);read(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]+c[i-1][j-1])%MOD;
	}
	f[1][0]=s[1][0]=1;
	for (int i=1;i<=N;i++)
	{
		for (int j=1;j<=i-1;j++)
			for (int k=1;k<=D;k++)
				f[i][k]=(f[i][k]+s[j][D-1]*c[i-2][j-1]%MOD*f[i-j][k-1]%MOD)%MOD;
		for (int j=1;j<=D;j++)	s[i][j]=(s[i][j-1]+f[i][j])%MOD;
	}
	for (int i=1;i<=N;i++)
	for (int j=0;j<=D;j++)
	for (int k=0;k<=D-j;k++)	if (k!=1)
		ans=(ans+f[i][j]*f[N-i+1][k]%MOD)%MOD;
	printf("%lld\n",ans*2*N*(N-1)%MOD);
	fclose(stdin);fclose(stdout);
	return 0;
}

#include <bits/stdc++.h>

using namespace std;

#define X first
#define Y second
#define mp make_pair
#define pb push_back
#define Debug(...) fprintf(stderr, __VA_ARGS__)

typedef long long LL;
typedef long double LD;
typedef unsigned int uint;
typedef pair <int, int> pii;
typedef unsigned long long uLL;

template <typename T> inline void Read(T &x) {
	char c = getchar();
	bool f = false;
	for (x = 0; !isdigit(c); c = getchar()) {
		if (c == '-') {
			f = true;
		}
	}
	for (; isdigit(c); c = getchar()) {
		x = x * 10 + c - '0';
	}
	if (f) {
		x = -x;
	}
}

template <typename T> inline bool CheckMax(T &a, const T &b) {
	return a < b ? a = b, true : false;
}

template <typename T> inline bool CheckMin(T &a, const T &b) {
	return a > b ? a = b, true : false;
}

const int N = 205;

uint ans, mod, c[N][N], f[N][N], s[N][N];
int n, m;

int main() {
	Read(n), Read(m), Read(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] + c[i - 1][j - 1]) % mod;
		}
	}
	f[1][0] = 1;
	for (int i = 0; i <= m; ++i) {
		s[1][i] = 1;
	}
	for (int i = 2; i <= n; ++i) {
		for (int j = 1; j < i; ++j) {
			for (int k = 0; k < m; ++k) {
				f[i][k + 1] = (1LL * s[j][m - 1] * c[i - 2][j - 1] % mod * f[i - j][k] + f[i][k + 1]) % mod;
			}
		}
		for (int j = 1; j <= m; ++j) {
			s[i][j] = (s[i][j - 1] + f[i][j]) % mod;
		}
	}
	for (int i = 0; i < n; ++i) {
		for (int j = 0; j <= m; ++j) {
			for (int k = 0; j + k <= m; ++k) {
				if (k != 1) {
					ans = (1LL * f[i + 1][j] * f[n - i][k] + ans) % mod;
				}
			}
		}
	}
	ans = 2LL * n * (n - 1) * ans % mod;
	printf("%u\n", ans);
	return 0;
}

#include<iostream>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<stdio.h>
#include<vector>
#include<map>
#include<set>
using namespace std;
int dp[222][222],n,d,m,c[222][222];
int main()
{
	scanf("%d%d%d",&n,&d,&m);
	int i,j,s,p,q;
	memset(dp,0,sizeof(dp));
	dp[0][0]=1;
	dp[1][1]=1;
	for(i=0;i<=n;i++)
	  for(j=0;j<=i;j++)
	  {
  		  if(j==0||j==i)
  		     c[i][j]=1;
	      else
	         c[i][j]=(1LL*c[i-1][j-1]+1LL*c[i-1][j])%m;
  	 }
	for(i=1;i<=n;i++)
	   for(j=1;j<=d;j++)
	   {
		   for(s=1;s<i&&j>1;s++)
           	   dp[i][j]=(dp[i][j]+1LL*dp[i-s][j-1]*dp[s][1]%m*c[i-1][s-1])%m;
           if(j<d||i+1==n)
               dp[i+1][1]=(1LL*dp[i+1][1]+1LL*dp[i][j])%m;
   	   }
    int ans=0;
    for(i=1;i<=n;i++)
	   for(j=0;j<=d;j++)
	      for(s=0;s+j<=d;s++)
	      {
	       	  if(s!=1)
  			    ans=(ans+1LL*dp[i-1][j]*dp[n-i][s])%m;
		  }
	printf("%d\n",1LL*ans*n%m*(n-1)%m*2%m);
	return 0;
}

#include <cstdio>
#include <cstring>
#include <algorithm>
#define int long long

using namespace std;

typedef long long ll;

int n, d, P, F[333][333], C[333][333];

ll powmod(ll x, ll y, ll p) {
    ll ans = 1;
    while(y) {
        if(y & 1) ans = ans * x % p;
        x = x * x % p;
        y >>= 1;
    }
    return ans;
}

void add(int &x, int y) {
    x = (x + y) % P;
}

#undef int
int main() {
#define int long long
    scanf("%lld%lld%lld", &n, &d, &P);
    for(int i = 0; i <= 300; i++)
        for(int j = 0; j <= i; j++)
            C[i][j] = !j ? 1 : (C[i - 1][j - 1] + C[i - 1][j]) % P;
    F[1][1] = 1;
    F[0][0] = 1;
    for(int i = 2; i <= n; i++) {
        for(int j = 1; j < d; j++)
            add(F[i][1], F[i - 1][j]);
        for(int j = 2; j <= d; j++)
            for(int k = 1; k <= i - 1; k++)
                add(F[i][j], F[k][j - 1] * F[i - k][1] % P * C[i - 1][i - k - 1]);
    }
    ll ans = 0;
    for(int i = 1; i <= n; i++)
        for(int j = 0; j <= d; j++)
            for(int k = 0; j + k <= d; k++)
                if(k != 1) add(ans, F[i - 1][j] * F[n - i][k]);
    printf("%lld\n", (ans * 2 * n * (n - 1) % P + P) % P);
    return 0;
}

#include<cstdio>
#include<algorithm>
#define fo(i,a,b) for(i=a;i<=b;i++)
using namespace std;
typedef long long ll;
const int maxn=200+10;
unsigned int f[maxn][maxn],s[maxn],c[maxn][maxn];
unsigned int i,j,k,l,t,n,m,ans,mo;
ll wdc;
int main(){
	//scanf("%d%d%d",&n,&m,&mo);
	scanf("%u%u%u",&n,&m,&mo);
	wdc=(ll)(mo-1)*(mo-1);
	c[0][0]=1;
	fo(i,1,n){
		c[i][0]=1;
		fo(j,1,i) c[i][j]=(c[i-1][j]+c[i-1][j-1])%mo;
	}
	f[1][0]=s[1]=1;
	fo(i,2,n){
		fo(k,1,m)
			fo(j,1,i-1)
				(f[i][k]+=(ll)f[i-j][k-1]*s[j]%mo*c[i-2][j-1]%mo)%=mo;
		fo(k,0,m-1) (s[i]+=f[i][k])%=mo;
	}
	fo(i,0,n-1)
		fo(j,0,m)
			fo(k,0,m-j)
				if (k!=1) (ans+=(ll)f[i+1][j]*f[n-i][k]%mo)%=mo;
	ans=(ll)ans*2%mo*n%mo*(n-1)%mo;
	(ans+=mo)%=mo;
	//printf("%d\n",ans);
	printf("%u\n",ans);
}

#include<cstdio>
const int maxn=210;

long long n,d,MOD,c[maxn][maxn],sum[maxn],ans,f[maxn][maxn];
int main(){
	scanf("%lld%lld%lld",&n,&d,&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;
	}
	f[1][0]=sum[1]=1;
	for(int i=2;i<=n;i++){
		for(int j=1;j<=d;j++){
			for(int k=1;k<i;k++){
				f[i][j]=(f[i][j]+f[i-k][j-1]*c[i-2][k-1]%MOD*sum[k])%MOD;
			}
			if(j!=d)sum[i]=(sum[i]+f[i][j])%MOD;
		}
	}
	for(int i=1;i<=n;i++)
		for(int j=0;j<=d;j++)
			for(int k=0;j+k<=d;k++)if(k!=1)
				ans=(ans+f[i][j]*f[n-i+1][k])%MOD;
	printf("%lld",2*n*(n-1)*ans%MOD);
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld double
#define llu unsigned long long
#define rep(i,x,y)  for(ll i=x;i<y;++i)
#define For(i,x,y)  for(ll i=x;i<=y;++i)
#define FOr(i,x,y)  for(ll i=x;i>=y;--i)
#define pi acos(-1)
#define mk make_pair<ll,ll>
#define pa pair<ll,ll>
#define lf else if
#define max(x,y)    ((x)<(y)?(y):(x))
#define min(x,y)    ((x)<(y)?(x):(y))
#define sqr(x)		((x)*(x))
#define abs(x)		((x)>0?(x):-(x))
#define Mul(x,y)    (x=1LL*x*(y)%mod)
#define Add(x,y)    (x=(x+(y))%mod)
#define Max(x,y)	(x=(x<(y)?(y):x))
#define Min(x,y)	(x=(x>(y)?(y):x))
#define E(x) 		return writeln(x),0
#define p(x)		printf("~%d~\n",x)
#define pp(x,y)		printf("~~%d %d~~\n",x,y)
#define ppp(x,y,z)	printf("~~~%d %d %d~~~\n",x,y,z)
#define f_in(x)		freopen(x".in","r",stdin)
#define f_out(x) 	freopen(x".out","w",stdout)
#define open(x)		f_in(x),f_out(x)
#define fi first
#define se second
typedef complex<double> E;
namespace SHENZHEBEI{
#ifdef LOCAL
    struct _{_(){freopen("cf.in","r",stdin);}}_;
#endif
#define NEG 1
    inline char gc(){   return getchar();	}
#if NEG
    inline ll read(){    ll x=0,f=1; char ch=gc();   for (;!isdigit(ch);ch=gc()) if (ch=='-') f=-1;  for (;isdigit(ch);ch=gc())  x=x*10-48+ch;   return x*f; }
    inline void write(ll x){    if (x<0) putchar('-'),x=-x;  if (x>=10)   write(x/10);    putchar(x%10+'0');  }
#else
    inline ll read(){    ll x=0; char ch=gc();   for (;!isdigit(ch);ch=gc());    for (;isdigit(ch);ch=gc())  x=x*10-48+ch;   return x;   }
    inline void write(ll x){    if (x>=10)   write(x/10);    putchar(x%10+'0');  }
#endif
    inline char readchar(){ char ch=gc();   for(;isspace(ch);ch=gc());  return ch;  }
    inline ll readstr(char *s){ char ch=gc();   int cur=0;  for(;isspace(ch);ch=gc());      for(;!isspace(ch);ch=gc())  s[cur++]=ch;    s[cur]='\0';    return cur; }
    inline void writeln(ll x){  write(x);   puts("");   }
    inline ld getreal(){	static ld lbc;	scanf("%lf",&lbc);	return lbc;	}
}using namespace SHENZHEBEI;
const ll N=210;
ll m,n,d,mod,c[N][N],f[N][N],g[N],ans;
int main(){
	n=read();	m=read();	mod=read();
	For(i,0,n){
		c[i][0]=1;
		For(j,1,i)c[i][j]=(c[i-1][j-1]+c[i-1][j])%mod;
	}f[1][0]=g[1]=1;
	For(i,2,n){
		For(j,1,i)For(k,1,m)Add(f[i][k],f[i-j][k-1]*g[j]%mod*c[i-2][j-1]);//pp(i-j,k-1);
		For(j,0,m-1)Add(g[i],f[i][j]);
	}
	For(i,0,m)For(j,0,m-i)if (j!=1)For(k,1,n)Add(ans,f[k][i]*f[n-k+1][j]);
	writeln(2ll*n*(n-1)%mod*ans%mod);
}
/*

*/

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld double
#define llu unsigned long long
#define rep(i,x,y)  for(ll i=x;i<y;++i)
#define For(i,x,y)  for(ll i=x;i<=y;++i)
#define FOr(i,x,y)  for(ll i=x;i>=y;--i)
#define pi acos(-1)
#define mk make_pair<ll,ll>
#define pa pair<ll,ll>
#define lf else if
#define max(x,y)    ((x)<(y)?(y):(x))
#define min(x,y)    ((x)<(y)?(x):(y))
#define sqr(x)		((x)*(x))
#define abs(x)		((x)>0?(x):-(x))
#define Mul(x,y)    (x=1LL*x*(y)%mod)
#define Add(x,y)    (x=(x+(y))%mod)
#define Max(x,y)	(x=(x<(y)?(y):x))
#define Min(x,y)	(x=(x>(y)?(y):x))
#define E(x) 		return writeln(x),0
#define p(x)		printf("~%d~\n",x)
#define pp(x,y)		printf("~~%d %d~~\n",x,y)
#define ppp(x,y,z)	printf("~~~%d %d %d~~~\n",x,y,z)
#define f_in(x)		freopen(x".in","r",stdin)
#define f_out(x) 	freopen(x".out","w",stdout)
#define open(x)		f_in(x),f_out(x)
#define fi first
#define se second
typedef complex<double> E;
namespace SHENZHEBEI{
#ifdef LOCAL
    struct _{_(){freopen("cf.in","r",stdin);}}_;
#endif
#define NEG 1
    inline char gc(){   return getchar();	}
#if NEG
    inline ll read(){    ll x=0,f=1; char ch=gc();   for (;!isdigit(ch);ch=gc()) if (ch=='-') f=-1;  for (;isdigit(ch);ch=gc())  x=x*10-48+ch;   return x*f; }
    inline void write(ll x){    if (x<0) putchar('-'),x=-x;  if (x>=10)   write(x/10);    putchar(x%10+'0');  }
#else
    inline ll read(){    ll x=0; char ch=gc();   for (;!isdigit(ch);ch=gc());    for (;isdigit(ch);ch=gc())  x=x*10-48+ch;   return x;   }
    inline void write(ll x){    if (x>=10)   write(x/10);    putchar(x%10+'0');  }
#endif
    inline char readchar(){ char ch=gc();   for(;isspace(ch);ch=gc());  return ch;  }
    inline ll readstr(char *s){ char ch=gc();   int cur=0;  for(;isspace(ch);ch=gc());      for(;!isspace(ch);ch=gc())  s[cur++]=ch;    s[cur]='\0';    return cur; }
    inline void writeln(ll x){  write(x);   puts("");   }
    inline ld getreal(){	static ld lbc;	scanf("%lf",&lbc);	return lbc;	}
}using namespace SHENZHEBEI;
const ll N=210;
ll m,n,d,mod,c[N][N],f[N][N],g[N],ans;
int main(){
	n=read();m=read();mod=read();f[1][0]=g[1]=1;
	For(i,0,n){c[i][0]=1;For(j,1,i)c[i][j]=(c[i-1][j-1]+c[i-1][j])%mod;}
	For(i,2,n){
		For(j,1,i)For(k,1,m)Add(f[i][k],f[i-j][k-1]*g[j]%mod*c[i-2][j-1]);//pp(i-j,k-1);
		For(j,0,m-1)Add(g[i],f[i][j]);
	}
	For(i,0,m)For(j,0,m-i)if (j!=1)For(k,1,n)Add(ans,f[k][i]*f[n-k+1][j]);
	writeln(2ll*n*(n-1)%mod*ans%mod);
}
/*

*/

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

const int MAXN = 205;

int N, D, M;
int dp[MAXN][MAXN][MAXN];
int pref[MAXN][MAXN];
int choose[MAXN][MAXN];
int pre[MAXN][MAXN];

void load() {
	scanf("%d%d%d", &N, &D, &M);
}

inline int add(int x, int y) {
	return x >= M - y ? x - (M - y) : x + y;
}

inline int mul(int x, int y) {
	return (long long)x * y % M;
}

int solve() {
	if (D == 1)
		return N == 2 ? 4 % M : 0;

	choose[0][0] = 1;
	for (int i = 1; i <= N; i++) {
		choose[i][0] = 1;
		for (int j = 1; j <= i; j++)
			choose[i][j] = add(choose[i - 1][j - 1], choose[i - 1][j]);
	}

	pref[1][0] = 1;
	for (int i = 1; i <= N; i++) {
		dp[i][0][0] = 1;
		for (int j = 1; j <= min(D, i - 1); j++)
			for (int k = 1; k < i; k++)
				for (int l = 1; l <= k; l++)
					dp[i][j][k] = add(dp[i][j][k], mul(dp[i][j - 1][k - l], pre[k][l]));
		for (int j = 1; j <= D; j++)
			pref[i][j] = add(pref[i][j - 1], dp[i][j][i - 1]);
		for (int k = i; k < N; k++)
			pre[k][i] = mul(choose[k - 1][i - 1], pref[i][D - 1]);
	}

	int sol = 0;
	for (int i = 1; i <= N; i++)
		for (int j = 2; j < D; j++)
			for (int k = 1; j + k <= D; k++)
				sol = add(sol, mul(dp[i][j][i - 1], dp[N - i + 1][k][N - i]));

	for (int i = 1; i <= D; i++)
		sol = add(sol, dp[N][i][N - 1]);

	for (int i = 2; i <= D; i++)
		sol = add(sol, dp[N][i][N - 1]);

	return mul(sol, mul(2, mul(N, N - 1)));
}

int main() {
	load();
	printf("%d\n", solve());
	return 0;
}

#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <cassert>
#include <string.h>
//#include <unordered_set>
//#include <unordered_map>
//#include <bits/stdc++.h>

#define MP(A,B) make_pair(A,B)
#define PB(A) push_back(A)
#define SIZE(A) ((int)A.size())
#define LEN(A) ((int)A.length())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define fi first
#define se second

using namespace std;

template<typename T>inline bool upmin(T &x,T y) { return y<x?x=y,1:0; }
template<typename T>inline bool upmax(T &x,T y) { return x<y?x=y,1:0; }

typedef long long ll;
typedef unsigned long long ull;
typedef long double lod;
typedef pair<int,int> PR;
typedef vector<int> VI;

const lod eps=1e-11;
const lod pi=acos(-1);
const int oo=1<<30;
const ll loo=1ll<<62;
const int MAXN=600005;
const int INF=0x3f3f3f3f;//1061109567
/*--------------------------------------------------------------------*/
inline int read()
{
	int f=1,x=0; char c=getchar();
	while (c<'0'||c>'9') { if (c=='-') f=-1; c=getchar(); }
	while (c>='0'&&c<='9') { x=(x<<3)+(x<<1)+(c^48); c=getchar(); }
	return x*f;
}
ll f[205][205],s[205],C[205][205],n,d,mods;
ll upd(ll x,ll y) { return x+y>=mods?x+y-mods:x+y; }
void Init()
{
	for (int i=0;i<=n;i++) C[i][0]=C[i][i]=1;
	for (int i=2;i<=n;i++)
		for (int j=1;j<i;j++) C[i][j]=upd(C[i-1][j],C[i-1][j-1]);
}
int main()
{
	n=read(),d=read(),mods=read();
	Init();
	f[1][0]=s[1]=1;
	for (int i=2;i<=n;i++)
		for (int j=1;j<=d;j++)
		{
			for (int k=1;k<=i-j;k++)
				f[i][j]=upd(f[i][j],f[i-k][j-1]*s[k]%mods*C[i-2][k-1]%mods);
			if (j!=d) s[i]=upd(s[i],f[i][j]);
		}
	ll ans=0;
	for (int i=1;i<=n;i++)
		for (int j=0;j<=d;j++)
			for (int k=0;k<=d-j;k++)
				if (k!=1) ans=upd(ans,f[i][j]*f[n-i+1][k]%mods);
	printf("%lld\n",ans*n%mods*(n-1)%mods*2%mods);
	return 0;
}

#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<algorithm>
#include<cmath>
#include<queue>
#include<vector>
#include<ctime>
#include<map>
#include<bitset>
#include<set>
#include<assert.h>
//#include<chrono>
//#include<random>
#include<iostream>
#define LL long long
#define mp(x,y) make_pair(x,y)
#define pll pair<long long,long long>
#define pii pair<int,int>
#define SZ(x) ((int)x.size())
#define VI vector<int>
using namespace std;
//mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
inline LL read()
{
	LL f=1,x=0;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
LL stack[20];
template<typename T>inline void write(T x)
{
	if(x<0){putchar('-');x=-x;}
    if(!x){putchar('0');return;}
    LL top=0;
    while(x)stack[++top]=x%10,x/=10;
    while(top)putchar(stack[top--]+'0');
}
template<typename T>inline void pr1(T x){write(x);putchar(' ');}
template<typename T>inline void pr2(T x){write(x);putchar('\n');}
template<typename T>inline void chkmin(T &x,T y){x=x<y?x:y;}
template<typename T>inline void chkmax(T &x,T y){x=x>y?x:y;}
const LL MAXN=205;
LL n,D,mod,opt;
void ad(LL &x,LL y){x+=y;if(x>=mod)x-=mod;}
void dl(LL &x,LL y){x-=y;if(x<0)x+=mod;}
LL coef[MAXN][MAXN],C[MAXN][MAXN];
//n=i j subtrees
//coef[i][1]
void getcoef()
{
	coef[0][0]=coef[1][1]=1;
	for(LL i=1;i<=n;i++)
	{
		for(LL j=1;j<=i;j++)
			for(LL k=1;k<i;k++)
				ad(coef[i][j],1LL*coef[i-k][j-1]*coef[k][1]%mod*C[i-1][k-1]%mod);
		LL S=0;
		for(LL j=1;j<D;j++)ad(S,coef[i][j]);
		ad(coef[i+1][1],S);
	}
}
int main()
{
//	freopen("b.in","r",stdin);
//	freopen("b.out","w",stdout);
	#ifdef Rose
		double BeginJudgeTime=clock();
	#endif
	n=read();D=read();mod=read();
//	if(!opt)
//	{
//		if(n<=2)return pr2(1%mod),0;
//		else if(D>1)return pr2(1%mod),0;
//		else return pr2(0),0;
//	}
	for(LL i=0;i<MAXN;i++)
	{
		C[i][0]=1;
		for(LL j=1;j<=i;j++)C[i][j]=C[i-1][j],ad(C[i][j],C[i-1][j-1]);
	}
	if(D==1)
	{
		if(n<=2)return pr2(1LL*1%mod*4%mod*C[n][2]%mod),0;
		else return pr2(0),0;
	}
	getcoef();LL ans=0;
	for(LL i=n;i>=1;i--)
	{
		for(LL j=0;j<=n-i;j++)
			for(LL k=2;k+j<=D;k++)
				ad(ans,1LL*coef[i-1][k]*coef[n-i][j]%mod);
	}
	for(int i=1;i<=D;i++)ad(ans,coef[n-1][i]);
	pr2(1LL*ans*4%mod*C[n][2]%mod);
	#ifdef Rose
		double EndJudgeTime=clock();
		cerr<<"JudgeTime is"<<" ";
		cerr<<(EndJudgeTime-BeginJudgeTime)/CLOCKS_PER_SEC<<endl;
	#endif
	return 0;
}

#include <bits/stdc++.h>
#define pb push_back

using namespace std;
typedef long long INT;
typedef pair <int, int> pii;
typedef vector <int> VI;

#define NN 210
int c[NN][NN], tree[NN][NN], sum[NN][NN];
int main (){
#ifndef ONLINE_JUDGE
	freopen ("in.in", "r", stdin);
	freopen ("out.out", "w", stdout);
#endif

	int n, d, m;
	cin >> n >> d >> m;

	for(int i=0; i<=n; i++) for(int j=c[i][0]=c[i][i]=1; j<i; j++) c[i][j]=((INT)c[i-1][j-1]+c[i-1][j])%m;

	tree[1][0]=1;
	for(int i=0; i<=d; i++) sum[1][i]=1;

	for(int i=2; i<=n; i++){
		for(int j=1; j<i; j++) for(int k=0; k<d; k++){
			tree[i][k+1]=((INT)c[i-2][j-1]*sum[j][d-1]%m*tree[i-j][k]+tree[i][k+1])%m;
		}
		for(int j=1; j<=d; j++) sum[i][j]=((INT)sum[i][j-1]+tree[i][j])%m;
	}

	int ans=0;
	for(int i=1; i<=n; i++) for(int j=0; j<=d; j++) for(int k=0; j+k<=d; k++) if(k!=1){
		ans=((INT)tree[i][j]*tree[n-i+1][k]+ans)%m;
	}

	cout << (2LL*n*(n-1)*ans%m) << endl;

	return 0;
}

#include <bits/stdc++.h>
using namespace std;
const int N=210;
typedef unsigned int ui;

ui n,d,mod,C[N][N],f[N][N],s[N];

int main() {
	cin>>n>>d>>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]+C[i-1][j-1])%mod;
	}
	f[1][0]=s[1]=1;
	for(int i=2;i<=n;i++) {
		for(int j=0;j<d;j++)
			for(int k=1;k<i;k++) f[i][j+1]=(f[i][j+1]+1ll*s[k]*f[i-k][j]%mod*C[i-2][k-1])%mod;
		for(int j=0;j<d;j++) s[i]=(s[i]+f[i][j])%mod;
	}
	int ans=0;
	for(int i=0;i<n;i++)
		for(int j=0;j<=d;j++)
			for(int k=0;j+k<=d;k++) if(k^1) ans=(ans+1ll*f[i+1][j]*f[n-i][k])%mod;
	cout<<2ll*n*(n-1)%mod*ans%mod;
	return 0;
}

# include <iostream>
# include <sstream>
# include <cstdio>
# include <cstdlib>
# include <algorithm>
# include <string>
# include <cstring>
# include <cmath>
# include <stack>
# include <queue>
# include <vector>
# include <list>
# include <map>
# include <set>
# include <deque>
# include <iterator>
# include <functional>
# include <bitset>
# include <climits>
# include <ctime>
using namespace std;
#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<(b)?(a):(b))
#define odd(x) ((x)&1)
#define sqr(x) ((x)*(x))
#define mp make_pair
#define pb push_back
#define fir first
#define sec second
#define all(x) (x).begin(),(x).end()
#define mem(a,x) memset(a,x,sizeof(a))
#define rep(i,a,b) for (int i=(a); i<=(b); ++i)
#define per(i,a,b) for (int i=(a); i>=(b); --i)
#define rep_it(it,x) for (__typeof((x).begin()) it=(x).begin(); it!=(x).end(); it++)
#define ____ puts("\n_______________\n\n")
#define debug(x) ____; cout<< #x << " => " << (x) << endl
#define debug_pair(x) cout<<"\n{ "<<(x).fir<<" , "<<(x).sec<<" }\n"
#define debug_arr(x,n) ____; cout<<#x<<":\n"; rep(i,0,n) cout<<#x<<"["<<(i)<<"] => "<<x[i]<<endl
#define debug_arr2(x,n,m) ____; cout<<#x<<":\n"; rep(i,0,n) rep(j,0,m) cout<<#x<<"["<<(i)<<"]["<<(j)<<"]= "<<x[i][j]<<((j==m)?"\n\n":"    ")
#define debug_set(x) ____; cout<<#x<<": \n"; rep_it(it,x) cout<<(*it)<<" "; cout<<endl
#define debug_map(x) ____; cout<<#x<<": \n"; rep_it(it,x) debug_pair(*it)
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef vector<int> vi;
const int oo = /*2 * 1000 * 1000 * 1000*/0x3f3f3f3f;
const ll ooo=9223372036854775807ll;
const int _cnt = 1000 * 1000 + 7;
const int _p = 1000 * 1000 * 1000 + 7;
const int N=100005;
const double PI=acos(-1.0);
const double eps=1e-9;
int o(int x) { return x%_p; }
int gcd(int a, int b) { return b ? gcd(b, a%b) : a; }
int lcm(int a, int b) { return a / gcd(a, b)*b; }

void file_put() {
    freopen("filename.in", "r", stdin);
    freopen("filename.out", "w", stdout);
}

unsigned int dp[205][205],s[205],C[205][205],n,d,m,ans=0;

int main() {
    //file_put();

    scanf("%d%d%d",&n,&d,&m);
    C[0][0]=dp[1][0]=s[1]=1;
    rep(i,1,n+2) {
    	C[i][0]=1;
    	rep(j,1,i) C[i][j]=((ll)C[i-1][j]+C[i-1][j-1])%m;
	}
	rep(i,2,n) {
		rep(j,1,d) rep(k,1,i-j) dp[i][j]=(dp[i][j]+(ll)dp[i-k][j-1]*s[k]%m*C[i-2][k-1]%m)%m;
		rep(j,1,d-1) s[i]=(s[i]+(ll)dp[i][j])%m;
	}
	rep(i,0,n-1) rep(j,0,d) rep(k,0,d) {
		if (j+k>d) break;
		if (k==1) continue;
		ans=(ans+(ll)dp[i+1][j]*dp[n-i][k]%m)%m;
	}
	printf("%d\n",(ll)2*n*(n-1)*ans%m);

    return 0;
}

#include<cstdio>
#include<iostream>
#include<cstring>
#include<cstdlib>
#include<algorithm>
#include<cmath>
using namespace std;
typedef long long LL;
const int _=1e2;
const int maxn=210;
int mod;
inline int ad(int x,int y){return x>=mod-y?x-mod+y:x+y;}
inline int re(int x,int y){return x<y?x-y+mod:x-y;}
inline int mu(int x,int y){return (LL)x*y%mod;}
inline int qp(int x,LL y){int r=1;while(y){if(y&1)r=mu(r,x);x=mu(x,x);y>>=1;}return r;}
inline int iv(int x){return qp(x,mod-2);}
inline int dv(int x,int y){return mu(x,qp(y,mod-2));}

int C[maxn][maxn];
void yu()
{
	for(int i=0;i<maxn;i++)
	{
		C[i][0]=1;
		for(int j=1;j<=i;j++)
			C[i][j]=ad(C[i-1][j],C[i-1][j-1]);
	}
}

int f[maxn][maxn],s[maxn];
int main()
{
	int n,D;
	scanf("%d%d%d",&n,&D,&mod); yu();
	if(D==1){printf("%d\n",(n<=2?mu(2,mu(n,(n-1))):0)%mod);return 0;}
	f[1][0]=1;s[1]=1;
	for(int i=2;i<=n;i++)
		for(int j=1;j<=D&&j<i;j++)
		{
			for(int k=1;k<=i-j;k++)
			{
				f[i][j]=ad(f[i][j],mu(mu(f[i-k][j-1],s[k]),C[i-2][k-1]));
			}
			if(j<D)s[i]=ad(s[i],f[i][j]);
		}
	int ans=0;
	for(int i=1;i<=n;i++)
	{
		for(int p1=0;p1<=D;p1++) if(p1!=1)
			for(int p2=0;p1+p2<=D;p2++) if(p2!=1)
				ans=ad(ans,mu(f[i][p1],f[n-i+1][p2]));

		for(int j=i+1;j<=n;j++)
			ans=ad(ans, mu(re(s[i],f[i][1]),re(s[n-j+1],f[n-j+1][1])) );
	}
	printf("%d\n",mu(mu(ans,2),mu(n,(n-1))));

	return 0;
}

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

const int MAXN = 205;

int N, D, M;
int dp[MAXN][MAXN][MAXN];
int pref[MAXN][MAXN];
int tot[MAXN];
int choose[MAXN][MAXN];

void load() {
	scanf("%d%d%d", &N, &D, &M);
}

inline int add(int x, int y) {
	x += y;
	if (x >= M)
		x -= M;
	else if (x < 0)
		x += M;
	return x;
}

inline int mul(int x, int y) {
	return (long long)x * y % M;
}

int solve() {
	if (D == 1)
		return N == 2 ? 4 % M : 0;

	choose[0][0] = 1;
	for (int i = 1; i <= N; i++) {
		choose[i][0] = 1;
		for (int j = 1; j <= i; j++)
			choose[i][j] = add(choose[i - 1][j - 1], choose[i - 1][j]);
	}

	for (int i = 1; i <= N; i++) {
		dp[i][0][0] = 1;
		for (int j = 1; j < D; j++) {
			dp[i][j][0] = 1;
			for (int k = 1; k < i; k++)
				for (int l = 1; l <= k; l++)
					dp[i][j][k] = add(dp[i][j][k], mul(dp[i][j - 1][k - l], mul(choose[k][l], pref[l][D - 1])));
			pref[i][j] = add(pref[i][j - 1], dp[i][j][i - 1]);
		}
		tot[i] = add(pref[i][D - 1], -pref[i][1]);
	}
	tot[1] = 1;

	int sol = 0;
	for (int i = 1; i <= N; i++)
		for (int j = i + 1; j <= N; j++)
			if (i > 1 || j < N)
				sol = add(sol, mul(tot[i], tot[N - j + 1]));

	for (int i = 2; i < N; i++)
		for (int j = 2; j < D; j++)
			for (int k = 2; k < D; k++)
				if (j + k <= D)
					sol = add(sol, mul(dp[i + 1][j][i], dp[N - i + 1][k][N - i]));

	int pot = 1;
	for (int i = 1; i < N; i++)
		pot = mul(pot, 2);

	sol = add(sol, add(pot, -1));

	return mul(sol, mul(2, mul(N, N - 1)));
}

int main() {
	load();
	printf("%d\n", solve());
	return 0;
}

#include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <list>
#include <cassert>
#include <ctime>
#include <climits>
using namespace std;

#define PB push_back
#define MP make_pair
#define SZ(v) ((int)(v).size())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define FORE(i,a,b) for(int i=(a);i<=(b);++i)
#define REPE(i,n) FORE(i,0,n)
#define FORSZ(i,a,v) FOR(i,a,SZ(v))
#define REPSZ(i,v) REP(i,SZ(v))
typedef long long ll;
typedef unsigned long long ull;
ll gcd(ll a,ll b) { return b==0?a:gcd(b,a%b); }

const int MAXN = 200;

int n, maxdeg, MOD;

int C[MAXN + 1][MAXN + 1];
int mono[MAXN + 1][MAXN + 1]; // mono[i][j] is # rooted trees with increasing paths with i nodes and the root having degree j
int monosum[MAXN + 1]; // monosum[i] is # rooted trees with increasing paths with i nodes and the root having degree 0..maxdeg-1

void run() {
	scanf("%d%d%d", &n, &maxdeg, &MOD);
	REPE(i, n) { C[i][0] = C[i][i] = 1; FOR(j, 1, i) C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]) % MOD; }

	memset(mono, 0, sizeof(mono));
	mono[1][0] = 1; if (maxdeg != 0) monosum[1] = 1;
	FORE(i, 2, n) {
		FORE(j, 1, maxdeg) FORE(ii, 1, i - 1) {
			int ways = C[i - 2][ii - 1];
			ways = (ll)ways*monosum[ii] % MOD;
			ways = (ll)ways*mono[i - ii][j - 1] % MOD;
			mono[i][j] = (mono[i][j] + ways) % MOD;
		}
		monosum[i] = 0; REPE(j, maxdeg - 1) monosum[i] = (monosum[i] + mono[i][j]) % MOD;
	}

	int duo = 0;
	REPE(j, n) duo = (duo + mono[n][j]) % MOD;
	FORE(i, 3, n) FORE(j, 2, maxdeg) REPE(jj, maxdeg - j) {
		int ways = (ll)mono[i][j] * mono[n - i + 1][jj] % MOD;
		duo = (duo + ways) % MOD;
	}
	int paths = (ll)n*(n - 1) % MOD;
	int ret = (ll)2 * duo*paths%MOD;
	printf("%d\n", ret);
}

int main() {
	run();
	return 0;
}

#include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <list>
#include <cassert>
#include <ctime>
#include <climits>
using namespace std;

#define PB push_back
#define MP make_pair
#define SZ(v) ((int)(v).size())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define FORE(i,a,b) for(int i=(a);i<=(b);++i)
#define REPE(i,n) FORE(i,0,n)
#define FORSZ(i,a,v) FOR(i,a,SZ(v))
#define REPSZ(i,v) REP(i,SZ(v))
typedef long long ll;
typedef unsigned long long ull;
ll gcd(ll a,ll b) { return b==0?a:gcd(b,a%b); }

const int MAXN = 200;

int n, maxdeg, MOD;

int C[MAXN + 1][MAXN + 1];
int mono[MAXN + 1][MAXN]; // mono[i][j] is # rooted trees with increasing paths with i nodes and the root having degree j
int monosum[MAXN + 1]; // monosum[i] is # rooted trees with increasing paths with i nodes and the root having degree 0..maxdeg-1

void run() {
	scanf("%d%d%d", &n, &maxdeg, &MOD);
	REPE(i, n) { C[i][0] = C[i][i] = 1; FOR(j, 1, i) C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]) % MOD; }

	memset(mono, 0, sizeof(mono));
	mono[1][0] = 1; if (maxdeg != 0) monosum[1] = 1;
	FORE(i, 2, n) {
		FORE(j, 1, maxdeg) FORE(ii, 1, i - 1) {
			int ways = C[i - 2][ii - 1];
			ways = (ll)ways*monosum[ii] % MOD;
			ways = (ll)ways*mono[i - ii][j - 1] % MOD;
			mono[i][j] = (mono[i][j] + ways) % MOD;
		}
		monosum[i] = 0; REPE(j, maxdeg - 1) monosum[i] = (monosum[i] + mono[i][j]) % MOD;
	}

	int duo = 0;
	REPE(j, n) duo = (duo + mono[n][j]) % MOD;
	FORE(i, 3, n) FORE(j, 2, maxdeg) REPE(jj, maxdeg - j) {
		int ways = (ll)mono[i][j] * mono[n - i + 1][jj] % MOD;
		duo = (duo + ways) % MOD;
	}
	int paths = (ll)n*(n - 1) % MOD;
	int ret = (ll)2 * duo*paths%MOD;
	printf("%d\n", ret);
}

int main() {
	run();
	return 0;
}

#include<bits/stdc++.h>
#define ri register int
#define pb push_back
#define fi first
#define se second
#define double long double
using namespace std;
const int rlen=1<<18|1;
char buf[rlen],*ib=buf,*ob=buf;
#define gc() getchar()
typedef long long ll;
typedef pair<int,int> pii;
inline int read(){
	int ans=0;
	char ch=gc();
	while(!isdigit(ch))ch=gc();
	while(isdigit(ch))ans=((ans<<2)+ans<<1)+(ch^48),ch=gc();
	return ans;
}
namespace modular{
	int mod;
	inline int add(int a,int b){return a+b<mod?a+b:a+b-mod;}
	inline int dec(int a,int b){return a<b?a-b+mod:a-b;}
	inline int mul(int a,int b){return (ll)a*b%mod;}
	inline void Add(int&a,int b){a=a+b<mod?a+b:a+b-mod;}
	inline void Dec(int&a,int b){a=a<b?a-b+mod:a-b;}
	inline void Mul(int&a,int b){a=(ll)a*b%mod;}
	inline int ksm(int a,int p){int ret=1;for(;p;p>>=1,Mul(a,a))(p&1)&&(Mul(ret,a),1);return ret;}
	inline int Inv(int a){return ksm(a,mod-2);}
	inline void fix(int&a){a=(a%mod+mod)%mod;}
}
using namespace modular;
const int N=205;
int C[N][N],n,K,f[N][N],s[N];
inline void init(){
	for(ri i=0;i<=n;++i){
		C[i][0]=1;
		for(ri j=1;j<=i;++j)C[i][j]=add(C[i-1][j-1],C[i-1][j]);
	}
}
int main(){
	#ifdef ldxcaicai
	freopen("lx.in","r",stdin);
	#endif
	n=read(),K=read(),mod=read();
	init();
	s[1]=f[1][0]=1;
	for(ri i=2;i<=n;++i){
		for(ri j=1;j<=K;++j){
			for(ri k=1;k<i;++k)Add(f[i][j],mul(mul(f[i-k][j-1],s[k]),C[i-2][k-1]));
			if(j<K)Add(s[i],f[i][j]);
		}
	}
	int res=0;
	for(ri i=1;i<=n;++i)for(ri j=0;j<=K;++j)for(ri k=0;j+k<=K;k?++k:k+=2)Add(res,mul(f[i][j],f[n-i+1][k]));
	cout<<mul(mul(res,2),mul(n,n-1));
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
#define mp make_pair

ull INF;
ull MOD;
ull add(ull x, ull y) {
	x += y;
	if (x >= MOD) return x - MOD;
	return x;
}
ull sub(ull x, ull y) {
	if (x < y) x += MOD;
	return x - y;
}
ull mult(ull x, ull y) {
	return (x * y) % MOD;
}

const int N = 222;
ull C[N][N];
int d;
ull a[N];
ull dp[N][N];

ull solve(int n) {
	for (int i = 0; i <= min(n - 1, d); i++)
		for (int j = 0; j < n; j++)
			dp[i][j] = 0;
	dp[0][n - 1] = 1;
	for (int i = 0; i < min(n - 1, d); i++)
		for (int x = 0; x < n; x++) {
			dp[i][x] %= MOD;
			if (dp[i][x] == 0) continue;
			for (int y = 1; y <= x; y++) {
				dp[i + 1][x - y] += dp[i][x] * (a[y] * C[x - 1][y - 1] % MOD) % MOD;
			}
		}
	ull res = 0;
	for (int i = 0; i <= min(n - 1, d); i++) {
		res += dp[i][0] % MOD;
	}
	return res % MOD;
}

int main()
{
//	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);

	int n;
	scanf("%d%d%llu", &n, &d, &MOD);
	if (n == 1) {
		throw;
		printf("0\n");
		return 0;
	}
	if (n == 2) {
		printf("%llu\n", 4 % MOD);
		return 0;
	}
	if (d == 1) {
		printf("0\n");
		return 0;
	}

	d--;
	for (int i = 0; i < N; i++)
		C[i][0] = C[i][i] = 1 % MOD;
	for (int i = 1; i < N; i++)
		for (int j = 1; j < i; j++)
			C[i][j] = add(C[i - 1][j - 1], C[i - 1][j]);
	a[0] = 1 % MOD;
	for (int i = 1; i < n; i++)
		a[i] = solve(i);
	d++;
	ll ans = solve(n);
	ans = (2 * (ans + MOD) - 1) % MOD;
	ans *= n * (n - 1) * 2;
	ans %= MOD;
	printf("%llu\n", ans);

	return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
#define mp make_pair

ull INF;
ull MOD;
ull add(ull x, ull y) {
	x += y;
	if (x >= MOD) return x - MOD;
	return x;
}
ull sub(ull x, ull y) {
	if (x < y) x += MOD;
	return x - y;
}
ull mult(ull x, ull y) {
	return (x * y) % MOD;
}

const int N = 222;
ull C[N][N];
int d;
ull a[N];
ull dp[N][N];

ull solve(int n) {
	for (int i = 0; i <= min(n - 1, d); i++)
		for (int j = 0; j < n; j++)
			dp[i][j] = 0;
	dp[0][n - 1] = 1;
	for (int i = 0; i < min(n - 1, d); i++)
		for (int x = 0; x < n; x++) {
			dp[i][x] %= MOD;
			if (dp[i][x] == 0) continue;
			for (int y = 1; y <= x; y++) {
				dp[i + 1][x - y] += dp[i][x] * (a[y] * C[x - 1][y - 1] % MOD);
				if (dp[i + 1][x - y] > INF) dp[i + 1][x - y] %= MOD;
			}
		}
	ull res = 0;
	for (int i = 0; i <= min(n - 1, d); i++) {
		res += dp[i][0];
		if (res > INF) res %= MOD;
	}
	return res % MOD;
}

int main()
{
//	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);

	int n;
	scanf("%d%d%llu", &n, &d, &MOD);
	INF = 1;
	INF <<= 63;
	INF--;
	INF <<= 1;
	INF -= MOD;
	if (n == 1) {
		printf("0\n");
		return 0;
	}
	if (n == 2) {
		printf("%llu\n", 4 % MOD);
		return 0;
	}
	if (d == 1) {
		printf("0\n");
		return 0;
	}

	d--;
	for (int i = 0; i < N; i++)
		C[i][0] = C[i][i] = 1 % MOD;
	for (int i = 1; i < N; i++)
		for (int j = 1; j < i; j++)
			C[i][j] = add(C[i - 1][j - 1], C[i - 1][j]);
	a[0] = 1 % MOD;
	for (int i = 1; i < n; i++)
		a[i] = solve(i);
	d++;
	ll ans = solve(n);
	ans = (2 * (ans + MOD) - 1) % MOD;
	ans *= n * (n - 1) * 2;
	ans %= MOD;
	printf("%llu\n", ans);

	return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
#define mp make_pair

ull INF;
ull MOD;
ull add(ull x, ull y) {
	x += y;
	if (x >= MOD) return x - MOD;
	return x;
}
ull sub(ull x, ull y) {
	if (x < y) x += MOD;
	return x - y;
}
ull mult(ull x, ull y) {
	return (x * y) % MOD;
}

const int N = 222;
ull C[N][N];
int d;
ull a[N];
ull dp[N][N];

ull solve(int n) {
	for (int i = 0; i <= min(n - 1, d); i++)
		for (int j = 0; j < n; j++)
			dp[i][j] = 0;
	dp[0][n - 1] = 1;
	for (int i = 0; i < min(n - 1, d); i++)
		for (int x = 0; x < n; x++) {
			dp[i][x] %= MOD;
			if (dp[i][x] == 0) continue;
			for (int y = 1; y <= x; y++) {
				dp[i + 1][x - y] += dp[i][x] * (a[y] * C[x - 1][y - 1] % MOD);
				if (dp[i + 1][x - y] > INF) dp[i + 1][x - y] %= MOD;
			}
		}
	ull res = 0;
	for (int i = 0; i <= min(n - 1, d); i++) {
		res += dp[i][0];
		if (res > INF) res %= MOD;
	}
	return res % MOD;
}

int main()
{
//	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);

	int n;
	scanf("%d%d%llu", &n, &d, &MOD);
	INF = 1;
	INF <<= 63;
	INF--;
	INF <<= 1;
	INF -= MOD * MOD;
	if (n == 1) {
		printf("0\n");
		return 0;
	}
	if (n == 2) {
		printf("%llu\n", 4 % MOD);
		return 0;
	}
	if (d == 1) {
		printf("0\n");
		return 0;
	}

	d--;
	for (int i = 0; i < N; i++)
		C[i][0] = C[i][i] = 1 % MOD;
	for (int i = 1; i < N; i++)
		for (int j = 1; j < i; j++)
			C[i][j] = add(C[i - 1][j - 1], C[i - 1][j]);
	a[0] = 1 % MOD;
	for (int i = 1; i < n; i++)
		a[i] = solve(i);
	d++;
	ll ans = solve(n);
	ans = (2 * (ans + MOD) - 1) % MOD;
	ans *= n * (n - 1) * 2;
	ans %= MOD;
	printf("%llu\n", ans);

	return 0;
}

#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <string.h>

using namespace std;

const int maxn = 205;
typedef long long LL;

int f[maxn][maxn];
int s[maxn][maxn];
int c[maxn][maxn],ans,n,m,mod;
int main()
{
	#ifndef ONLINE_JUDGE
//		freopen("trees.in","r",stdin);
	#endif
	scanf("%d %d %d",&n,&m,&mod);
	for (int i=0;i<=n;i++)
	{
		c[i][0]=c[i][i]=1;
		for (int j=1;j<i;j++)
			c[i][j]=((LL)c[i-1][j-1]+c[i-1][j])%mod;
	}
	f[1][0]=1;
	for (int i=0;i<=m;i++) s[1][i]=1;

	for (int i=2;i<=n;i++)
	{
		f[i][1]=1;
		for (int j=2;j<=m;j++)
		for (int k=1;k<i;k++)
			f[i][j]=(f[i][j]+(LL)f[i-k][j-1]*(LL)s[k][m-1]%mod*(LL)c[i-2][k-1])%mod;
		for (int j=1;j<=m;j++)
			s[i][j]=((LL)s[i][j-1]+f[i][j])%mod;
	}

	int ans=0;
	for (int i=1;i<=n;i++)
	for (int j=0;j<=m;j++)
	for (int k=0;j+k<=m;k++)
		if (k!=1) ans=(ans+(LL)f[i][j]*f[n-i+1][k])%mod;
	ans=(LL)ans*n%mod*(n-1)%mod*2ll%mod;
	printf("%d",ans%mod);
	return 0;
}

/*
  Beautiful Codes are MUCH better than 'Shorter' ones !
user  : triveni
date  : 03/02/2018
time  : 05:25:05
*/
#include <bits/stdc++.h>

using namespace std;

#define      pii               std::pair<int,int>
#define      vi                std::vector<int>
#define      sz(v)             (int)(v.size())
#define      mp(a,b)           make_pair(a,b)
#define      pb(a)             push_back(a)
#define      each(it,s)        for(auto it = s.begin(); it != s.end(); ++it)
#define      rep(i, n)         for(int i = 0; i < (n); ++i)
#define      fill(a,v)         memset(a, v, sizeof (a))
#define      all(v)            v.begin(), v.end()
#define      scan(n)           scanf("%d", &n)
#define      scan2(n, m)       scanf("%d%d", &n, &m)
#define      pin(n)            printf("%d\n",n)
#define      pll(n)            printf("%lld\n", n)
#define      X                 first
#define      Y                 second

typedef long long ll;
ll mod = 1000000007;
#define int ll

inline int pow_(long long a, int n, int p=mod){
int r=1;while(n){if(n&1)r=r*a%p;n>>=1;a=a*a%p;}return r;}
inline int inv_(int a) {return pow_(a, mod-2, mod);}
inline int add(int a, int b){a+=b;if(a>=mod)a-=mod;return a;}
inline int mul(int a, int b){return a*1L*b%mod;}
inline int sub(int a, int b){a-=b;if(a<0)a+=mod;return a;}

int d, dp[210][210];
int ncr[210][210];

int treeCnt(int n, int deg) {
	int & r = dp[n][deg];
	if (r >= 0) return r; else r = 0;
	if (deg >= n) return r;
	if (deg == 0) return r = (n == 1);

	if(deg == 1) {
		rep(dg, d) r = add(r, treeCnt(n-1, dg));
		return r;
	}

	for (int s = 2; s < n; ++s) {
		int tmp = mul(treeCnt(s, 1), treeCnt(n - s + 1, deg - 1));
		tmp = mul(tmp, ncr[n-2][s-2]);
		r = add(r, tmp);
	}
	return r;
}

main()
{
	rep(i, 210) rep(j, 210) if(i==j||j==0) ncr[i][j] = 1;
		else ncr[i][j]=add(ncr[i-1][j-1], ncr[i-1][j]);

	int n = 100; d = 50;
	scanf("%lld%lld%lld", &n, &d, &mod);
	fill(dp, -1);

	vector<int> ans(d + 1);
	for (int deg = 1; deg <= d; ++deg) {
		for (int d1 = 0; d1 <= deg; ++d1) if(d1 != 1) {
			for (int n1 = 0; n1 < n; ++n1) {
				int tmp = mul(treeCnt(n - n1, deg - d1), treeCnt(n1 + 1, d1));
				ans[deg] = add(ans[deg], tmp);
			}
		}
	}
	int f_ans = accumulate(all(ans), 0L) % mod;
	f_ans = mul(f_ans, 2 * n * (n-1));
	pll(f_ans);

	return 0;
}

/*
  Beautiful Codes are MUCH better than 'Shorter' ones !
user  : triveni
date  : 03/02/2018
time  : 05:25:05
*/
#include <bits/stdc++.h>

using namespace std;

#define      pii               std::pair<int,int>
#define      vi                std::vector<int>
#define      sz(v)             (int)(v.size())
#define      mp(a,b)           make_pair(a,b)
#define      pb(a)             push_back(a)
#define      each(it,s)        for(auto it = s.begin(); it != s.end(); ++it)
#define      rep(i, n)         for(int i = 0; i < (n); ++i)
#define      fill(a,v)         memset(a, v, sizeof (a))
#define      all(v)            v.begin(), v.end()
#define      scan(n)           scanf("%d", &n)
#define      scan2(n, m)       scanf("%d%d", &n, &m)
#define      pin(n)            printf("%d\n",n)
#define      pll(n)            printf("%lld\n", n)
#define      X                 first
#define      Y                 second

typedef long long ll;
ll mod = 1000000007;
#define int ll

inline int pow_(long long a, int n, int p=mod){
int r=1;while(n){if(n&1)r=r*a%p;n>>=1;a=a*a%p;}return r;}
inline int inv_(int a) {return pow_(a, mod-2, mod);}
inline int add(int a, int b){a+=b;if(a>=mod)a-=mod;return a;}
inline int mul(int a, int b){return a*1L*b%mod;}
inline int sub(int a, int b){a-=b;if(a<0)a+=mod;return a;}

int d, dp[210][210];
int ncr[210][210];

int treeCnt(int n, int deg) {
	int & r = dp[n][deg];
	if (r >= 0) return r; else r = 0;
	if (deg >= n) return r;
	if (deg == 0) return r = (n == 1);

	if(deg == 1) {
		rep(dg, d) r = add(r, treeCnt(n-1, dg));
		return r;
	}

	for (int s = 2; s < n; ++s) {
		int tmp = mul(treeCnt(s, 1), treeCnt(n - s + 1, deg - 1));
		tmp = mul(tmp, ncr[n-2][s-2]);
		r = add(r, tmp);
	}
	return r;
}

main()
{
	int n = 100; d = 50;
	scanf("%lld%lld%lld", &n, &d, &mod);
	fill(dp, -1);

	rep(i, 210) rep(j, 210) if(i==j||j==0) ncr[i][j] = 1;
		else ncr[i][j]=add(ncr[i-1][j-1], ncr[i-1][j]);

	vector<int> ans(d + 1);
	for (int deg = 1; deg <= d; ++deg) {
		for (int d1 = 0; d1 <= deg; ++d1) if(d1 != 1) {
			for (int n1 = 0; n1 < n; ++n1) {
				int tmp = mul(treeCnt(n - n1, deg - d1), treeCnt(n1 + 1, d1));
				ans[deg] = add(ans[deg], tmp);
			}
		}
	}
	int f_ans = accumulate(all(ans), 0L) % mod;
	f_ans = mul(f_ans, 2 * n * (n-1));
	pll(f_ans);

	return 0;
}

#include <bits/stdc++.h>

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define SZ(x) ((int) (x).size())
#define ALL(x) x.begin(), x.end()

using namespace std;
typedef long long LL;
typedef vector<int> VI;
typedef pair<int, int> pii;

template <typename T> inline bool cmin(T & a, const T & b) { return a > b ? a = b, 1 : 0;}
template <typename T> inline bool cmax(T & a, const T & b) { return a < b ? a = b, 1 : 0;}

const int MaxN = 205;
int n, d, M, c[MaxN][MaxN], f[MaxN][MaxN], g[MaxN];
int main() {
	cin >> n >> d >> M;
	c[0][0] = 1;
	for (int i = 1; i <= n; i++) {
		c[i][0] = 1;
		for (int j = 1; j <= i; j++)
			c[i][j] = (c[i - 1][j] + c[i - 1][j - 1]) % M;
	}
	f[1][0] = 1;
	for (int i = 2; i <= n; i++) {
		for (int k = 0; k < d; k++)
			(g[i - 1] += f[i - 1][k]) %= M;
		for (int j = 1; j < i; j++)
			for (int k = 0; k < d; k++)
				f[i][k + 1] = (f[i][k + 1] + (LL) f[i - j][k] * g[j] % M * c[i - 2][j - 1]) % M;
	}
	int ans = 0;
	for (int i = 0; i < n; i++)
		for (int j = 0; j <= d; j++)
			for (int k = 0; j + k <= d; k++) {
				if(k == 1) continue;
				ans = (ans + (LL) f[i + 1][j] * f[n - i][k]) % M;
			}
	ans = (LL) ans * 2 * n * (n - 1) % M;
	cout << ans << endl;
	return 0;
}

#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define SZ(x) ((int)x.size())
#define L(i,u) for (register int i=head[u]; i; i=nxt[i])
#define rep(i,a,b) for (register int i=(a); i<=(b); i++)
#define per(i,a,b) for (register int i=(a); i>=(b); i--)
using namespace std;
typedef long long ll;
typedef unsigned int ui;
typedef pair<int,int> Pii;
typedef vector<int> Vi;
template<class T> inline void read(T &x){
	x=0; char c=getchar(); int f=1;
	while (!isdigit(c)) {if (c=='-') f=-1; c=getchar();}
	while (isdigit(c)) {x=x*10+c-'0'; c=getchar();} x*=f;
}
template<class T> inline void umin(T &x, T y){x=x<y?x:y;}
template<class T> inline void umax(T &x, T y){x=x>y?x:y;}
inline ui R() {
	static ui seed=416;
	return seed^=seed>>5,seed^=seed<<17,seed^=seed>>13;
}
const int N = 205;
int n,d;ll dp[N],f[N][N],C[N][N];int mo;
inline void add(ll&a,ll b){a=a+b<mo?a+b:a+b-mo;}
int main() {
	read(n);read(d);read(mo);f[0][0]=1;
	rep(i,0,n){
		C[i][0]=C[i][i]=1;
		rep(j,1,i-1)C[i][j]=(C[i-1][j-1]+C[i-1][j])%mo;
	}
	rep(i,1,n){
		rep(j,1,d-1)add(dp[i],f[j][i-1]);if(i==1)dp[i]=1;
		rep(j,1,i)rep(k,1,i)
			f[j][i]=(f[j][i]+1LL*C[i-1][k-1]*dp[k]%mo*f[j-1][i-k])%mo;
	//	printf("%d:%d\n",i,dp[i]);
	//	rep(j,1,i)printf("%d %d : %d\n",j,i,f[j][i]);
	}
	ll res=0;
	rep(l,1,n)rep(r,l+1,n)res=(res+1LL*(l==1?1:dp[l]-f[1][l-1])*(r==n?1:dp[n-r+1]-f[1][n-r]))%mo;
	rep(p,2,n-1)rep(i,2,d)rep(j,2,d-i)res=(res+1LL*f[i][p-1]*f[j][n-p])%mo;
	rep(i,2,d)res=(res+2LL*f[i][n-1])%mo;
	res=2LL*res*n*(n-1)%mo;
	cout<<(res%mo+mo)%mo;
	return 0;
}

#include<bits/stdc++.h>
#define o 1000005
#define re register int
#define ll long long
#define g0(a) memset(a,0,sizeof(a))
#define gc(a,b) memcpy(a,b,sizeof(a))
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define REP(i,a,b) for(int i=a;i>=b;i--)
#define pa pair<int,int>
#define mpp make_pair
#define s1 first
#define s2 second
using namespace std;
inline int read()
{
	register int data=0,w=1;
	char ch=0;
	while(ch!='-'&&(ch<'0'||ch>'9'))ch=getchar();
	if(ch=='-')w=-1,ch=getchar();
	while(ch>='0'&&ch<='9')data=(data<<1)+(data<<3)+(ch^48),ch=getchar();
	return data*w;
}
int n,d,mod,c[205][205],ans,f[205][205],g[o];
int main()
{
	n=read(),d=read(),mod=read();
	if(mod==1)return puts("0"),0;
	c[0][0]=1;
	FOR(i,1,n)c[i][0]=1;
	FOR(i,1,n)FOR(j,1,n)c[i][j]=(c[i-1][j-1]+c[i-1][j])%mod;
	f[1][0]=g[1]=1;
	FOR(i,2,n)
		FOR(j,1,d)
		{
			FOR(k,1,i-1)f[i][j]=(f[i][j]+1ll*f[i-k][j-1]*c[i-2][k-1]%mod*g[k])%mod;
			g[i]=(g[i]+f[i][j]*(j!=d))%mod;
		}
	int ans=0;
	FOR(i,1,n)FOR(j,0,d)FOR(k,0,d-j)if(k!=1)ans=(ans+1ll*f[i][j]*f[n-i+1][k])%mod;
	cout<<1ll*ans*2*n%mod*(n-1)%mod<<'\n';
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=205;
int n,d,m,f[N][N],c[N][N],g[N];
inline void add(int&x,int y){x=x+y<m?x+y:x+y-m;}
inline int he(int x,int y){return x+y<m?x+y:x+y-m;}
int main(){
	//freopen("aa.in","r",stdin);
	int i,j,k;
	scanf("%d%d%d",&n,&d,&m);
	for(c[0][0]=i=1;i<=n;++i)for(c[i][0]=j=1;j<=i;++j)c[i][j]=he(c[i-1][j],c[i-1][j-1]);
	f[1][0]=g[1]=1;
	for(i=2;i<=n;++i){
		for(j=1;j<=d;++j){
			for(k=1;k<i;++k){
				add(f[i][j],1LL*f[k][j-1]*g[i-k]%m*c[i-2][k-1]%m);
			}
			if(j<d)add(g[i],f[i][j]);
		}
	}
	int ans=0;
	for(i=1;i<=n;++i){
		for(j=0;j<=d;++j){
			for(k=0;k<=d-j;++k)if(k!=1){
				add(ans,1LL*f[i][j]*f[n+1-i][k]%m);
			}
		}
	}
	ans=2LL*ans*n*(n-1)%m;
	printf("%d",ans);
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=205;
int n,d,m,f[N][N],c[N][N],g[N];
inline void add(int&x,int y){x=x+y<m?x+y:x+y-m;}
inline int he(int x,int y){return x+y<m?x+y:x+y-m;}
int main(){
	//freopen("aa.in","r",stdin);
	int i,j,k;
	scanf("%d%d%d",&n,&d,&m);
	for(c[0][0]=i=1;i<=n;++i)for(c[i][0]=j=1;j<=i;++j)c[i][j]=he(c[i-1][j],c[i-1][j-1]);
	f[1][0]=g[1]=1;
	for(i=2;i<=n;++i){
		for(j=1;j<=d;++j){
			for(k=1;k<i;++k){
				add(f[i][j],1LL*f[k][j-1]*g[i-k]%m*c[i-2][j-1]%m);
			}
			if(j<d)add(g[i],f[i][j]);
		}
	}
	int ans=0;
	for(i=1;i<=n;++i){
		for(j=0;j<=d;++j){
			for(k=0;k<=d-j;++k)if(k!=1){
				add(ans,1LL*f[i][j]*f[n+1-i][k]%m);
			}
		}
	}
	ans=2LL*ans*n*(n-1)%m;
	printf("%d",ans);
	return 0;
}

#include <bits/stdc++.h>
#define mset(a, b) memset(a, b, sizeof(a))
#define mcpy(a, b) memcpy(a, b, sizeof(a))
using namespace std;
typedef long long LL;
const int N = 205;

template <typename T> inline void read(T &AKNOI) {
	T x = 0, flag = 1;
	char ch = getchar();
	while (!isdigit(ch)) {
		if (ch == '-') flag = -1;
		ch = getchar();
	}
	while (isdigit(ch)) {
		x = x * 10 + ch - '0';
		ch = getchar();
	}
	AKNOI = flag * x;
}

namespace ModCalculator {
	LL MOD;
	inline void Inc(LL &x, LL y) {
		x += y; if (x >= MOD) x -= MOD;
	}
	inline void Dec(LL &x, LL y) {
		x -= y; if (x < 0) x += MOD;
	}
	inline LL Add(LL x, LL y) {
		Inc(x, y); return x;
	}
	inline LL Sub(LL x, LL y) {
		Dec(x, y); return x;
	}
	inline int Mul(LL x, LL y) {
		return x * y % MOD;
	}
}
using namespace ModCalculator;

int n, d;
LL C[N][N], dp[N][N], sum[N], ans;

void init() {
	read(n); read(d); read(MOD);
	for (int i = 0; i <= n; ++i) {
		C[i][0] = 1;
		for (int j = 1; j <= i; ++j) {
			C[i][j] = Add(C[i - 1][j], C[i - 1][j - 1]);
		}
	}
}

void solve() {
	dp[1][0] = sum[1] = 1;
	for (int i = 2; i <= n; ++i) {
		for (int j = 1; j <= d; ++j) {
			for (int k = 1; k < i; ++k) {
				Inc(dp[i][j], Mul(C[i - 2][k - 1], Mul(sum[k], dp[i - k][j - 1])));
			}
			if (j < d) Inc(sum[i], dp[i][j]);
		}
	}
	for (int i = 1; i <= n; ++i) {
		for (int j = 0; j <= d; ++j) {
			for (int k = 0; k + j <= d; ++k) {
				if (k == 1) continue;
				Inc(ans, Mul(dp[i][j], dp[n - i + 1][k]));
			}
		}
	}
	printf("%lld\n", Mul(ans, 2LL * n * (n - 1)));
}

int main() {
	init();
	solve();
	return 0;
}

#include "iostream"
#include "algorithm"
#include "cstring"
#include "cstdio"
#include "cmath"
#include "vector"
#include "map"
#include "set"
#include "queue"
using namespace std;
#define MAXN 5006
//#define int long long
#define rep(i, a, b) for (int i = (a), i##end = (b); i <= i##end; ++i)
#define per(i, a, b) for (int i = (a), i##end = (b); i >= i##end; --i)
#define pii pair<int,int>
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define vi vector<int>
#define all(x) (x).begin() , (x).end()
#define mem( a ) memset( a , 0 , sizeof a )
#define int unsigned
typedef long long ll;
int n , d , P , op;
int A[MAXN];
int C[MAXN][MAXN] , dp[MAXN][MAXN] , S[MAXN];
void solve() {
	cin >> n >> d >> P;
	C[0][0] = 1;
	rep( i , 1 , n ) {
		C[i][0] = 1;
		rep( j , 1 , i ) C[i][j] = ( C[i - 1][j] + C[i - 1][j - 1] ) % P;
	}
	dp[1][0] = 1; S[1] = 1;
	rep( i , 2 , n ) {
		rep( k , 1 , i - 1 ) {
			rep( j , 1 , i ) {
				dp[i][j] = ( dp[i][j] + dp[i - k][j - 1] * 1ll * S[k] % P * C[i - 2][k - 1] ) % P;
			}
		}
		rep( j , 0 , d - 1 ) S[i] = ( S[i] + dp[i][j] ) % P;
	}
	int as = 0;
	rep( i , 1 , n ) rep( j , 0 , d ) rep( k , 0 , d ) if( j + k <= d ) as = ( as + dp[i][j] * 1ll * dp[n - i + 1][k] ) % P;
	rep( i , 1 , n ) rep( j , 0 , d - 1 ) rep( k , 0 , d - 1 ) as = ( as + P - dp[i][j] * 1ll * dp[n - i][k] % P ) % P;
	cout << as * 2ll * n % P * ( n - 1 ) << endl;
}

signed main() {
//    int T;cin >> T;while( T-- ) solve();
    solve();
}

#include<bits/stdc++.h>
using namespace std;
#define fu(a,b,c) for(int a=b;a<=c;a++)
#define fd(a,b,c) for(int a=b;a>=c;a--)
int read(){
	int ans=0,w=1;char c=getchar();
	while(!isdigit(c)&&c!='-')c=getchar();
	if(c=='-')w=-1,c=getchar();
	while(isdigit(c))ans=(ans<<1)+(ans<<3)+c-'0',c=getchar();
	return ans*w;
}
#define N 210
#define Mod 98244353
#define LL long long
int n,d;
LL ans=0,c[N][N],f[N][N],s[N][N];
void init(){
	fu(i,0,n){
		c[i][0]=1;
		fu(j,1,i)c[i][j]=(c[i-1][j]+c[i-1][j-1])%Mod;
	}
	fu(i,0,d)s[1][i]=1;
	f[1][0]=1;
}
int main(){
	n=read();d=read();
	init();
	fu(i,2,n){
		fu(j,1,i-1)
			fu(k,0,d-1)
				f[i][k+1]=(s[j][d-1]*c[i-2][j-1]%Mod*f[i-j][k]%Mod+f[i][k+1])%Mod;
		fu(j,1,d)s[i][j]=(s[i][j-1]+f[i][j])%Mod;
	}
	fu(i,0,n-1)
		fu(j,0,d)
			fu(k,0,d-j)if(k!=1)
				ans=(ans+f[i+1][j]*f[n-i][k]%Mod)%Mod;
	ans=2ll*n*(n-1)*ans%Mod;
	printf("%lld",ans);
	return 0;
}

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<vector>
#include<queue>
#include<set>
//#define ls (rt<<1)
//#define rs (rt<<1|1)
#define vi vector<int>
#define pb push_back
#define mk make_pair
#define pii pair<int,int>
#define rep(i,a,b) for(int i=(a),i##end=(b);i<=i##end;i++)
#define fi first
#define se second
#define mod m
typedef long long ll;
using namespace std;
const int maxn=205;
int c[maxn][maxn];
int dp[maxn][maxn],sum[maxn];
int main(){
	//freopen("in","r",stdin);
    int n,d,m,ty;scanf("%d%d%d",&n,&d,&m);
   // cout<<n<<' '<<d<<' '<<m<<' '<<ty<<endl;
    rep(i,0,maxn-1){
    	c[0][i]=1;
    	rep(j,1,i)c[j][i]=(1ll*c[j-1][i-1]+c[j][i-1])%mod;
	}
	dp[1][0]=1,sum[1]=1;
	rep(i,2,n){rep(j,1,d)
		rep(k,1,i-1){
			dp[i][j]=(dp[i][j]+1ll*dp[i-k][j-1]*sum[k]%mod*c[k-1][i-2]%mod)%mod;
		}
		rep(u,0,d-1)sum[i]=(1ll*sum[i]+dp[i][u])%mod;
	}
	int ans=0;
	rep(i,1,n){
		rep(j,0,d)for(int k=0;j+k<=d;k++){
			ans=(ans+1ll*dp[i][j]*dp[n-i+1][k])%mod;
		}
	}
	rep(i,1,n)rep(j,0,d-1)rep(k,0,d-1){
		ans=(ans-1ll*dp[i][j]*dp[n-i][k])%mod;
	}
	ans=(ans%mod+mod)%mod;
	printf("%d",2ll * ((n * 1ll * (n - 1)) % m) % m * ans % m);
    return 0;
}

#include<cstdio>
#include<cmath>
#include<algorithm>
#include<cstdlib>
#include<cstring>
using namespace std;
inline int read()
{
	int x=0,f=1;char ch=getchar();
	while(ch<'0' || ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0' && ch<='9')x=x*10+ch-'0',ch=getchar();
	return x*f;
}
int stack[20];
inline void write(int x)
{
	if(x<0){putchar('-');x=-x;}
	if(!x){putchar('0');return;}
	int top=0;
	while(x)stack[++top]=x%10,x/=10;
	while(top)putchar(stack[top--]+'0');
}
inline void pr1(int x){write(x),putchar(' ');}
inline void pr2(int x){write(x),puts("");}
int mod;
inline int ad(int x){return x>=mod?x-mod:x;}
inline int dec(int x){return x<0?x+mod:x;}
int g[210],f[210][210],C[210][210];
int main()
{
    //freopen("a.in","r",stdin);
    //freopen("a.out","w",stdout);
    for(int i=0;i<=200;i++)
    {
    	C[i][0]=1;
    	for(int j=1;j<=i;j++)C[i][j]=ad(C[i-1][j]+C[i-1][j-1]);
    }
    int n=read(),d=read();mod=read();
    if(d==1)
    {
    	if(n>2)pr2(0);
    	else pr2(4%mod);
    	return 0;
    }
    f[1][0]=g[1]=1;
    for(int i=2;i<=n;i++)
    {
    	for(int j=1;j<min(d+1,i);j++)
    	{
    		for(int k=1;k<i;k++)f[i][j]=ad(f[i][j]+1LL*f[i-k][j-1]*g[k]%mod*C[i-2][k-1]%mod);
    		if(j<d)g[i]=ad(g[i]+f[i][j]);
    	}
    }
    for(int i=2;i<=n;i++)f[i][0]=1;
    int ans=0;
    for(int i=1;i<=n;i++)
    {
    	for(int j=1;j<=n-i;j++)ans=ad(ans+1LL*dec(g[i]-f[i][1])*dec(g[j]-f[j][1])%mod);
    	for(int j=0;j<=d;j++)
    	{
    		if(j==1 || (i!=1 && j==0))continue;
    		for(int k=0;k<=d-j;k++)
    		{
    			if(k==1 || (i!=n && k==0))continue;
    			ans=ad(ans+1LL*f[i][j]*f[n+1-i][k]%mod);
    		}
    	}
    }
    pr2(ad(1LL*ans*n%mod*(n-1)%mod*2));
    return 0;
}

#include<cstdio>
#include<cmath>
#include<algorithm>
#include<cstdlib>
#include<cstring>
using namespace std;
inline int read()
{
	int x=0,f=1;char ch=getchar();
	while(ch<'0' || ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0' && ch<='9')x=x*10+ch-'0',ch=getchar();
	return x*f;
}
int stack[20];
inline void write(int x)
{
	if(x<0){putchar('-');x=-x;}
	if(!x){putchar('0');return;}
	int top=0;
	while(x)stack[++top]=x%10,x/=10;
	while(top)putchar(stack[top--]+'0');
}
inline void pr1(int x){write(x),putchar(' ');}
inline void pr2(int x){write(x),puts("");}
int mod;
inline int ad(int x){return x>=mod?x-mod:x;}
inline int dec(int x){return x<0?x+mod:x;}
int g[210],f[210][210],C[210][210];
int main()
{
    //freopen("a.in","r",stdin);
    //freopen("a.out","w",stdout);
    for(int i=0;i<=200;i++)
    {
    	C[i][0]=1;
    	for(int j=1;j<=i;j++)C[i][j]=ad(C[i-1][j]+C[i-1][j-1]);
    }
    int n=read(),d=read();mod=read();
    if(d==1)
    {
    	if(n>2)pr2(0);
    	else pr2(4%mod);
    	return 0;
    }
    f[1][0]=g[1]=1;
    for(int i=2;i<=n;i++)
    {
    	for(int j=1;j<min(d+1,i);j++)
    	{
    		for(int k=1;k<i;k++)f[i][j]=ad(f[i][j]+1LL*f[i-k][j-1]*g[k]%mod*C[i-2][k-1]%mod);
    		if(j<d)g[i]=ad(g[i]+f[i][j]);
    	}f[i][0]=1;
    }
    int ans=0;
    for(int i=1;i<=n;i++)
    {
    	for(int j=1;j<=n-i;j++)ans=ad(ans+1LL*dec(g[i]-f[i][1])*dec(g[j]-f[j][1])%mod);
    	for(int j=0;j<=d;j++)
    	{
    		if(j==1)continue;
    		for(int k=0;k<=d-j;k++)
    		{
    			if(k==1)continue;
    			if(j==0 && k==0)continue;
    			ans=ad(ans+1LL*f[i][j]*f[n+1-i][k]%mod);
    		}
    	}
    }
    pr2(ad(1LL*ans*n%mod*(n-1)%mod*2));
    return 0;
}

#include<cstdio>
#include<cmath>
#include<algorithm>
#include<cstdlib>
#include<cstring>
using namespace std;
inline int read()
{
	int x=0,f=1;char ch=getchar();
	while(ch<'0' || ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0' && ch<='9')x=x*10+ch-'0',ch=getchar();
	return x*f;
}
int stack[20];
inline void write(int x)
{
	if(x<0){putchar('-');x=-x;}
	if(!x){putchar('0');return;}
	int top=0;
	while(x)stack[++top]=x%10,x/=10;
	while(top)putchar(stack[top--]+'0');
}
inline void pr1(int x){write(x),putchar(' ');}
inline void pr2(int x){write(x),puts("");}
int mod;
inline int ad(int x){return x>=mod?x-mod:x;}
inline int dec(int x){return x<0?x+mod:x;}
int g[210],f[210][210],C[210][210];
int main()
{
    //freopen("a.in","r",stdin);
    //freopen("a.out","w",stdout);
    int n=read(),d=read();mod=read();
	for(int i=0;i<=n;i++)
    {
    	C[i][0]=1;
    	for(int j=1;j<=i;j++)C[i][j]=ad(C[i-1][j]+C[i-1][j-1]);
    }
    if(d==1)
    {
    	if(n>2)pr2(0);
    	else pr2(4%mod);
    	return 0;
    }
    f[1][0]=g[1]=1;
    for(int i=2;i<=n;i++)
    {
    	for(int j=1;j<min(d+1,i);j++)
    	{
    		for(int k=1;k<i;k++)f[i][j]=ad(f[i][j]+1LL*f[i-k][j-1]*g[k]%mod*C[i-2][k-1]%mod);
    		if(j<d)g[i]=ad(g[i]+f[i][j]);
    	}
    }
    for(int i=2;i<=n;i++)f[i][0]=1;
    int ans=0;
    for(int i=1;i<=n;i++)
    {
    	for(int j=1;j<=n-i;j++)ans=ad(ans+1LL*dec(g[i]-f[i][1])*dec(g[j]-f[j][1])%mod);
    	for(int j=0;j<=d;j++)
    	{
    		if(j==1 || (i!=1 && j==0))continue;
    		for(int k=0;k<=d-j;k++)
    		{
    			if(k==1 || (i!=n && k==0))continue;
    			ans=ad(ans+1LL*f[i][j]*f[n+1-i][k]%mod);
    		}
    	}
    }
    pr2(ad(1LL*ans*n%mod*(n-1)%mod*2));
    return 0;
}

#include<cstdio>
#include<cmath>
#include<algorithm>
#include<cstdlib>
#include<cstring>
using namespace std;
inline int read()
{
	int x=0,f=1;char ch=getchar();
	while(ch<'0' || ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0' && ch<='9')x=x*10+ch-'0',ch=getchar();
	return x*f;
}
int stack[20];
inline void write(int x)
{
	if(x<0){putchar('-');x=-x;}
	if(!x){putchar('0');return;}
	int top=0;
	while(x)stack[++top]=x%10,x/=10;
	while(top)putchar(stack[top--]+'0');
}
inline void pr1(int x){write(x),putchar(' ');}
inline void pr2(int x){write(x),puts("");}
int mod;
inline int ad(int x){return x>=mod?x-mod:x;}
inline int dec(int x){return x<0?x+mod:x;}
int g[210],f[210][210],C[210][210];
int main()
{
    //freopen("a.in","r",stdin);
    //freopen("a.out","w",stdout);
    for(int i=0;i<=200;i++)
    {
    	C[i][0]=1;
    	for(int j=1;j<=i;j++)C[i][j]=ad(C[i-1][j]+C[i-1][j-1]);
    }
    int n=read(),d=read();mod=read();
    if(d==1)
    {
    	if(n>2)pr2(0);
    	else pr2(4%mod);
    	return 0;
    }
    f[1][0]=g[1]=1;
    for(int i=2;i<=n;i++)
    {
    	for(int j=1;j<min(d+1,i);j++)
    	{
    		for(int k=1;k<i;k++)f[i][j]=ad(f[i][j]+1LL*f[i-k][j-1]*g[k]%mod*C[i-2][k-1]%mod);
    		if(j<d)g[i]=ad(g[i]+f[i][j]);
    	}
    }
    int ans=0;
    for(int i=1;i<=n;i++)
    {
    	for(int j=1;j<=n-i;j++)ans=ad(ans+1LL*dec(g[i]-f[i][1])*dec(g[j]-f[j][1])%mod);
    	for(int j=0;j<=d;j++)
    	{
    		if(j==1)continue;
    		for(int k=0;k<=d-j;k++)
    		{
    			if(k==1)continue;
    			ans=ad(ans+1LL*f[i][j]*f[n+1-i][k]%mod);
    		}
    	}
    }
    pr2(ad(1LL*ans*n%mod*(n-1)%mod*2));
    return 0;
}

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

const int N = 205;

#define ll long long

void exgcd(int a, int b, int& x, int& y) {
	if (!b) {
		x = 1, y = 0;
	} else {
		exgcd(b, a % b, y, x);
		y -= (a / b) * x;
	}
}

int inv(int a, int n) {
	int x, y;
	exgcd(a, n, x, y);
	return (x < 0) ? (x + n) : (x);
}

int Mod;

typedef class Z {
	public:
		int v;

		Z() : v(0) {	}
		Z(int x) : v(x){	}
		Z(ll x) : v(x % Mod) {	}

		friend Z operator + (const Z& a, const Z& b) {
			return (ll) a.v + b.v;
		}
		friend Z operator - (const Z& a, const Z& b) {
			return (ll) a.v - b.v;
		}
		friend Z operator * (const Z& a, const Z& b) {
			return Z(a.v * 1ll * b.v);
		}
		friend Z operator ~(const Z& a) {
			return inv(a.v, Mod);
		}
		friend Z operator - (const Z& a) {
			return Z(0) - a;
		}
		Z& operator += (Z b) {
			return *this = *this + b;
		}
		Z& operator -= (Z b) {
			return *this = *this - b;
		}
		Z& operator *= (Z b) {
			return *this = *this * b;
		}
		friend boolean operator == (const Z& a, const Z& b) {
			return a.v == b.v;
		}
} Z;

typedef Z Zi;

int n, d;
Zi comb[N][N];
Zi f[N][N], g[N];

int main(){
	scanf("%d%d%d", &n, &d, &Mod);
	if (Mod == 1) {
		puts("0");
		return 0;
	}
	comb[0][0] = 1;
	for (int i = 1; i <= n; i++) {
		comb[i][0] = comb[i][i] = 1;
		for (int j = 1; j < i; j++) {
			comb[i][j] = comb[i - 1][j - 1] + comb[i - 1][j];
		}
	}

	f[1][0] = 1, g[1] = 1;
	for (int i = 2; i <= n; i++) {
		for (int j = 1; j <= d; j++) {
			for (int k = 1; k < i; k++) {
				f[i][j] += f[i - k][j - 1] * g[k] * comb[i - 2][k - 1];
			}
			g[i] += f[i][j];
		}
	}

	Zi ans = 0;
	for (int i = 1; i <= n; i++) {
		for (int x = 0; x <= d; x++) {
			for (int y = 0; x + y <= d; y++) {
				if (y == 1) {
					continue;
				}
				ans += f[i][x] * f[n - i + 1][y];
			}
		}
	}
	ans = ans * n * (n - 1) * 2;
	printf("%d\n", ans.v);
	return 0;
}

#include<bits/stdc++.h>
#define ll long long
#define ull unsigned ll
#define uint unsigned
#define pii pair<int,int>
#define pll pair<ll,ll>
#define IT iterator
#define PB push_back
#define fi first
#define se second
#define For(i,j,k) for (int i=(int)(j);i<=(int)(k);i++)
#define Rep(i,j,k) for (int i=(int)(j);i>=(int)(k);i--)
#define CLR(a,v) memset(a,v,sizeof(a));
#define CPY(a,b) memcpy(a,b,sizeof(a));
#define debug puts("wzpakking")
#define y1 ysghysgsygsh
using namespace std;
const int N=205;
int n,d,mo,ans,tr[N];
int C[N][N],f[N][N];
int main(){
	scanf("%d%d%d",&n,&d,&mo);
	For(i,0,n) C[i][0]=1%mo;
	For(i,1,n) For(j,1,i)
		C[i][j]=(C[i-1][j]+C[i-1][j-1])%mo;
	f[1][0]=1;
	For(i,1,n){
		int S=0; tr[0]=1;
		For(j,0,d-1) S=(S+f[i][j])%mo;
		For(j,1,min(n/i,d)) tr[j]=1ll*tr[j-1]*C[i*j-1][i-1]%mo*S%mo;
		Rep(j,n,0) For(k1,1,min(n/i,d)) For(k2,0,d-k1)
			f[j][k1+k2]=(f[j][k1+k2]+1ll*f[j-k1*i][k2]*tr[k1]%mo*C[j-1][k1*i])%mo;
	}
	For(i,0,n-1) For(j,0,d) For(k,0,d-j)
		if (k!=1) ans=(ans+1ll*f[i+1][j]*f[n-i][k])%mo;
	printf("%d\n",2ll*n*(n-1)*ans%mo);
}

#include<iostream>
#include<vector>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<ctime>
#include<queue>
#include<set>
#include<map>
#include<stack>
#include<bitset>

#define pb push_back
#define mp make_pair

using namespace std;

template<typename T>inline void upmin(T &x,T y) { y<x?x=y:0; }
template<typename T>inline void upmax(T &x,T y) { x<y?x=y:0; }

typedef unsigned int u32;
typedef long long LL;
typedef unsigned long long ULL;
typedef long double lod;
typedef pair<int,int> PR;
typedef vector<int> VI;

const lod pi=acos(-1);
const int oo=1<<30;
const LL OO=1e18;

const int N=210;

int gi() {
	int w=0;bool q=1;char c=getchar();
	while ((c<'0'||c>'9') && c!='-') c=getchar();
	if (c=='-') q=0,c=getchar();
	while (c>='0'&&c <= '9') w=w*10+c-'0',c=getchar();
	return q? w:-w;
}

LL f[N][N],g[N],C[N][N];
int main()
{
#ifndef ONLINE_JUDGE
	freopen("H.in","r",stdin);
	freopen("H.out","w",stdout);
#endif
	int n=gi(),d=gi(),mod=gi(),i,j,k;LL ans=0;
	for (i=0;i<=n;i++)
		for (j=C[i][0]=1;j<=i;j++)
			C[i][j]=(C[i-1][j]+C[i-1][j-1])%mod;
	f[1][0]=g[1]=1;
	for (i=2;i<=n;i++) {
		for (j=1;j<=d;j++)
			for (k=1;k<i;k++)
				f[i][j]=(f[i][j]+f[i-k][j-1]*C[i-2][k-1])%mod;
		for (j=1;j<d;j++)
			(g[i]+=f[i][j])%=mod;
	}
	for (i=0;i<=d;i++)
		for (j=0;i+j<=d;j++)
			for (k=1;k<=n;k++)
				ans=(ans+f[k][i]*f[n-k+1][j])%mod;
	if (d>1) ans-=n-1;
	if (ans<0) ans+=mod;
	ans=ans*2*n*(n-1)%mod;
	cout<<ans<<endl;
	return 0;
}

#include<iostream>
#include<vector>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<ctime>
#include<queue>
#include<set>
#include<map>
#include<stack>
#include<bitset>

#define pb push_back
#define mp make_pair

using namespace std;

template<typename T>inline void upmin(T &x,T y) { y<x?x=y:0; }
template<typename T>inline void upmax(T &x,T y) { x<y?x=y:0; }

typedef unsigned int u32;
typedef long long LL;
typedef unsigned long long ULL;
typedef long double lod;
typedef pair<int,int> PR;
typedef vector<int> VI;

const lod pi=acos(-1);
const int oo=1<<30;
const LL OO=1e18;

const int N=210;

int gi() {
	int w=0;bool q=1;char c=getchar();
	while ((c<'0'||c>'9') && c!='-') c=getchar();
	if (c=='-') q=0,c=getchar();
	while (c>='0'&&c <= '9') w=w*10+c-'0',c=getchar();
	return q? w:-w;
}

LL f[N][N],g[N],C[N][N];
int main()
{
#ifndef ONLINE_JUDGE
	freopen("H.in","r",stdin);
	freopen("H.out","w",stdout);
#endif
	int n=gi(),d=gi(),mod=gi(),i,j,k;LL ans=0;
	for (i=0;i<=n;i++)
		for (j=C[i][0]=1;j<=i;j++)
			C[i][j]=(C[i-1][j]+C[i-1][j-1])%mod;
	f[1][0]=g[1]=1;
	for (i=2;i<=n;i++) {
		for (j=1;j<=d;j++)
			for (k=1;k<i;k++)
				f[i][j]=(f[i][j]+f[i-k][j-1]*C[i-2][k-1]%mod*g[k])%mod;
		for (j=1;j<d;j++)
			(g[i]+=f[i][j])%=mod;
	}
	for (i=0;i<=d;i++)
		for (j=0;i+j<=d;j++)
			for (k=1;k<=n;k++)
				ans=(ans+f[k][i]*f[n-k+1][j])%mod;
	if (n==2||d>1) ans-=n-1;
	if (ans<0) ans+=mod;
	ans=ans*2*n*(n-1)%mod;
	cout<<ans<<endl;
	return 0;
}

#include<iostream>
#include<vector>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<ctime>
#include<queue>
#include<set>
#include<map>
#include<stack>
#include<bitset>

#define pb push_back
#define mp make_pair

using namespace std;

template<typename T>inline void upmin(T &x,T y) { y<x?x=y:0; }
template<typename T>inline void upmax(T &x,T y) { x<y?x=y:0; }

typedef unsigned int u32;
typedef long long LL;
typedef unsigned long long ULL;
typedef long double lod;
typedef pair<int,int> PR;
typedef vector<int> VI;

const lod pi=acos(-1);
const int oo=1<<30;
const LL OO=1e18;

const int N=210;

int gi() {
	int w=0;bool q=1;char c=getchar();
	while ((c<'0'||c>'9') && c!='-') c=getchar();
	if (c=='-') q=0,c=getchar();
	while (c>='0'&&c <= '9') w=w*10+c-'0',c=getchar();
	return q? w:-w;
}

LL f[N][N],g[N],C[N][N];
int main()
{
#ifndef ONLINE_JUDGE
	freopen("H.in","r",stdin);
	freopen("H.out","w",stdout);
#endif
	int n=gi(),d=gi(),mod=gi(),i,j,k;LL ans=0;
	for (i=0;i<=n;i++)
		for (j=C[i][0]=1;j<=i;j++)
			C[i][j]=(C[i-1][j]+C[i-1][j-1])%mod;
	f[1][0]=g[1]=1;
	for (i=2;i<=n;i++) {
		for (j=1;j<=d;j++)
			for (k=1;k<i;k++)
				f[i][j]=(f[i][j]+f[i-k][j-1]*C[i-2][k-1])%mod;
		for (j=1;j<d;j++)
			(g[i]+=f[i][j])%=mod;
	}
	for (i=0;i<=d;i++)
		for (j=0;i+j<=d;j++)
			for (k=1;k<=n;k++)
				ans=(ans+f[k][i]*f[n-k+1][j])%mod;
	if (n==2||d>1) ans-=n-1;
	if (ans<0) ans+=mod;
	ans=ans*2*n*(n-1)%mod;
	cout<<ans<<endl;
	return 0;
}

#include<iostream>
#include<vector>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<ctime>
#include<queue>
#include<set>
#include<map>
#include<stack>
#include<bitset>

#define pb push_back
#define mp make_pair

using namespace std;

template<typename T>inline void upmin(T &x,T y) { y<x?x=y:0; }
template<typename T>inline void upmax(T &x,T y) { x<y?x=y:0; }

typedef unsigned int u32;
typedef long long LL;
typedef unsigned long long ULL;
typedef long double lod;
typedef pair<int,int> PR;
typedef vector<int> VI;

const lod pi=acos(-1);
const int oo=1<<30;
const LL OO=1e18;

const int N=210;

int gi() {
	int w=0;bool q=1;char c=getchar();
	while ((c<'0'||c>'9') && c!='-') c=getchar();
	if (c=='-') q=0,c=getchar();
	while (c>='0'&&c <= '9') w=w*10+c-'0',c=getchar();
	return q? w:-w;
}

LL f[N][N],g[N],C[N][N];
int main()
{
#ifndef ONLINE_JUDGE
	freopen("H.in","r",stdin);
	freopen("H.out","w",stdout);
#endif
	int n=gi(),d=gi(),mod=gi(),i,j,k;LL ans=0;
	for (i=0;i<=n;i++)
		for (j=C[i][0]=1;j<=i;j++)
			C[i][j]=(C[i-1][j]+C[i-1][j-1])%mod;
	f[1][0]=g[1]=1;
	for (i=2;i<=n;i++) {
		for (j=1;j<=d;j++)
			for (k=1;k<i;k++)
				f[i][j]=(f[i][j]+f[i-k][j-1]*C[i-2][k-1])%mod;
		for (j=1;j<d;j++)
			(g[i]+=f[i][j])%=mod;
	}
	for (i=0;i<=d;i++)
		for (j=0;i+j<=d;j++)
			for (k=1;k<=n;k++)
				ans=(ans+f[k][i]*f[n-k+1][j])%mod;
	ans-=n-1;
	if (ans<0) ans+=mod;
	ans=ans*2*n*(n-1)%mod;
	cout<<ans<<endl;
	return 0;
}

//starusc
#include<bits/stdc++.h>
using namespace std;
#define ll long long
inline int read(){
	int x=0,f=1;char c=getchar();
	while(!isdigit(c)){if(c=='-')f=-1;c=getchar();}
	while(isdigit(c)){x=(x<<1)+(x<<3)+(c^48);c=getchar();}
	return f==1?x:-x;
}
const int N=204;
int n,d,ans,mod,c[N][N],f[N][N],sum[N];
signed main(){
	n=read();d=read();mod=read();
	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;
	}
	f[1][0]=sum[1]=1;
	for(int i=2;i<=n;i++){
		for(int j=1;j<=min(i,d);j++){
			for(int k=1;k<i;k++){
				f[i][j]=(f[i-k][j-1]*sum[k]%mod*c[i-2][k-1]+f[i][j])%mod;
			}
			if(j!=d)sum[i]=(f[i][j]+sum[i])%mod;//
		}
	}
	for(int i=1;i<=n;i++){
		for(int u=0;u<=d;u++){
			for(int v=0;u+v<=d;v++)if(v!=1){//
				ans=(f[i][u]*f[n-i+1][v]+ans)%mod;
			}
		}
	}
	cout<<ans*n%mod*(n-1)%mod*2%mod;
	return (0-0);
}

//starusc
#include<bits/stdc++.h>
using namespace std;
#define ll long long
inline int read(){
	int x=0,f=1;char c=getchar();
	while(!isdigit(c)){if(c=='-')f=-1;c=getchar();}
	while(isdigit(c)){x=(x<<1)+(x<<3)+(c^48);c=getchar();}
	return f==1?x:-x;
}
const int N=204;
int n,d,ans,mod,c[N][N],f[N][N],sum[N];
signed main(){
	n=read();d=read();mod=read();
	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;
	}
	f[1][0]=sum[1]=1;
	for(int i=2;i<=n;i++){
		for(int j=1;j<=min(i,d);j++){
			for(int k=1;k<i;k++){
				f[i][j]=(f[i-k][j-1]*sum[k]%mod*c[i-2][k-1]%mod+f[i][j])%mod;
			}
			if(j!=d)sum[i]=(f[i][j]+sum[i])%mod;//
		}
	}
	for(int i=1;i<=n;i++){
		for(int u=0;u<=d;u++){
			for(int v=0;u+v<=d;v++)if(v!=1){//
				ans=(f[i][u]*f[n-i+1][v]+ans)%mod;
			}
		}
	}
	cout<<ans*n%mod*(n-1)%mod*2%mod;
	return (0-0);
}

//starusc
#include<bits/stdc++.h>
using namespace std;
#define ll long long
inline int read(){
	int x=0,f=1;char c=getchar();
	while(!isdigit(c)){if(c=='-')f=-1;c=getchar();}
	while(isdigit(c)){x=(x<<1)+(x<<3)+(c^48);c=getchar();}
	return f==1?x:-x;
}
const int N=204;
int n,d,ans,mod,c[N][N],f[N][N],sum[N];
signed main(){
	n=read();d=read();mod=read();
	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;
	}
	f[1][0]=sum[1]=1;
	for(int i=2;i<=n;i++){
		for(int j=1;j<=min(i,d);j++){
			for(int k=1;k<i;k++){
				f[i][j]=(f[i-k][j-1]*sum[k]%mod*c[i-2][k-1]+f[i][j])%mod;
			}
			if(j!=d)sum[i]=(f[i][j]+sum[i])%mod;//
		}
	}
	for(int i=1;i<=n;i++){
		for(int u=0;u<=d;u++){
			for(int v=0;u+v<=d;v++)if(v!=1){//
				ans=(f[i][u]*f[n-i+1][v]+ans)%mod;
			}
		}
	}
	cout<<ans*n%mod*(n-1)*2%mod;
	return (0-0);
}

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
using namespace std;

#ifdef LOCAL
	#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
	#define eprintf(...) 42
#endif

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
#define mp make_pair

ull INF;
ull MOD;
ull add(ull x, ull y) {
	x += y;
	if (x >= MOD) return x - MOD;
	return x;
}
ull sub(ull x, ull y) {
	if (x < y) x += MOD;
	return x - y;
}
ull mult(ull x, ull y) {
	return (x * y) % MOD;
}

const int N = 222;
ull C[N][N];
int d;
ull a[N];
ull dp[N][N];

ull solve(int n) {
	for (int i = 0; i <= min(n - 1, d); i++)
		for (int j = 0; j < n; j++)
			dp[i][j] = 0;
	dp[0][n - 1] = 1 % MOD;
	for (int i = 0; i < min(n - 1, d); i++)
		for (int x = 0; x < n; x++) {
			dp[i][x] %= MOD;
			if (dp[i][x] == 0) continue;
			for (int y = 1; y <= x; y++) {
				dp[i + 1][x - y] += dp[i][x] * ((a[y] * C[x - 1][y - 1]) % MOD) % MOD;
			}
		}
	ull res = 0;
	for (int i = 0; i <= min(n - 1, d); i++) {
		res += dp[i][0] % MOD;
	}
	return res % MOD;
}

int main()
{
//	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);

	int n;
	scanf("%d%d%llu", &n, &d, &MOD);
	if (n == 1) {
		throw;
		printf("0\n");
		return 0;
	}
	if (n == 2) {
		ull ans = 4;
		printf("%llu\n", ans % MOD);
		return 0;
	}
	if (d == 1) {
		printf("0\n");
		return 0;
	}

	d--;
	for (int i = 0; i < N; i++)
		C[i][0] = C[i][i] = 1 % MOD;
	for (int i = 1; i < N; i++)
		for (int j = 1; j < i; j++)
			C[i][j] = add(C[i - 1][j - 1], C[i - 1][j]);
	a[0] = 1 % MOD;
	for (int i = 1; i < n; i++)
		a[i] = solve(i);
	d++;
	ll ans = solve(n);
	ans = (2 * (ans + MOD) - 1) % MOD;
	ans *= n * (n - 1) * 2;
	ans %= MOD;
	printf("%llu\n", ans);

	return 0;
}

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
using namespace std;

#ifdef LOCAL
	#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
	#define eprintf(...) 42
#endif

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
#define mp make_pair

ull INF;
ull MOD;
ull add(ull x, ull y) {
	x += y;
	if (x >= MOD) return x - MOD;
	return x;
}
ull sub(ull x, ull y) {
	if (x < y) x += MOD;
	return x - y;
}
ull mult(ull x, ull y) {
	return (x * y) % MOD;
}

const int N = 222;
ull C[N][N];
int d;
ull a[N];
ull dp[N][N];

ull solve(int n) {
	for (int i = 0; i <= min(n - 1, d); i++)
		for (int j = 0; j < n; j++)
			dp[i][j] = 0;
	dp[0][n - 1] = 1;
	for (int i = 0; i < min(n - 1, d); i++)
		for (int x = 0; x < n; x++) {
			dp[i][x] %= MOD;
			if (dp[i][x] == 0) continue;
			for (int y = 1; y <= x; y++) {
				dp[i + 1][x - y] += dp[i][x] * (a[y] * C[x - 1][y - 1] % MOD);
				if (dp[i + 1][x - y] > INF) dp[i + 1][x - y] %= MOD;
			}
		}
	ull res = 0;
	for (int i = 0; i <= min(n - 1, d); i++) {
		res += dp[i][0];
		if (res > INF) res %= MOD;
	}
	return res % MOD;
}

int main()
{
//	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);

	int n;
	scanf("%d%d%llu", &n, &d, &MOD);
	INF = 1;
	INF <<= 63;
	INF--;
	INF <<= 1;
	INF -= MOD;
	if (n == 1) {
		printf("0\n");
		return 0;
	}
	if (n == 2) {
		printf("%llu\n", 4 % MOD);
		return 0;
	}
	if (d == 1) {
		printf("0\n");
		return 0;
	}

	d--;
	for (int i = 0; i < N; i++)
		C[i][0] = C[i][i] = 1 % MOD;
	for (int i = 1; i < N; i++)
		for (int j = 1; j < i; j++)
			C[i][j] = add(C[i - 1][j - 1], C[i - 1][j]);
	a[0] = 1 % MOD;
	for (int i = 1; i < n; i++)
		a[i] = solve(i);
	d++;
	ll ans = solve(n);
	ans = (2 * (ans + MOD) - 1) % MOD;
	ans *= n * (n - 1) * 2;
	ans %= MOD;
	printf("%llu\n", ans);

	return 0;
}

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
using namespace std;

#ifdef LOCAL
	#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
	#define eprintf(...) 42
#endif

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
#define mp make_pair

ull INF;
ull MOD;
ull add(ull x, ull y) {
	x += y;
	if (x >= MOD) return x - MOD;
	return x;
}
ull sub(ull x, ull y) {
	if (x < y) x += MOD;
	return x - y;
}
ull mult(ull x, ull y) {
	return (x * y) % MOD;
}

const int N = 222;
ull C[N][N];
int d;
ull a[N];
ull dp[N][N];

ull solve(int n) {
	for (int i = 0; i <= min(n - 1, d); i++)
		for (int j = 0; j < n; j++)
			dp[i][j] = 0;
	dp[0][n - 1] = 1;
	for (int i = 0; i < min(n - 1, d); i++)
		for (int x = 0; x < n; x++) {
			dp[i][x] %= MOD;
			if (dp[i][x] == 0) continue;
			for (int y = 1; y <= x; y++) {
				dp[i + 1][x - y] += dp[i][x] * (a[y] * C[x - 1][y - 1] % MOD) % MOD;
			}
		}
	ull res = 0;
	for (int i = 0; i <= min(n - 1, d); i++) {
		res += dp[i][0] % MOD;
	}
	return res % MOD;
}

int main()
{
//	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);

	int n;
	scanf("%d%d%llu", &n, &d, &MOD);
	if (n == 1) {
		throw;
		printf("0\n");
		return 0;
	}
	if (n == 2) {
		printf("%llu\n", 4 % MOD);
		return 0;
	}
	if (d == 1) {
		printf("0\n");
		return 0;
	}

	d--;
	for (int i = 0; i < N; i++)
		C[i][0] = C[i][i] = 1 % MOD;
	for (int i = 1; i < N; i++)
		for (int j = 1; j < i; j++)
			C[i][j] = add(C[i - 1][j - 1], C[i - 1][j]);
	a[0] = 1 % MOD;
	for (int i = 1; i < n; i++)
		a[i] = solve(i);
	d++;
	ll ans = solve(n);
	ans = (2 * (ans + MOD) - 1) % MOD;
	ans *= n * (n - 1) * 2;
	ans %= MOD;
	printf("%llu\n", ans);

	return 0;
}

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
using namespace std;

#ifdef LOCAL
	#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
	#define eprintf(...) 42
#endif

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
#define mp make_pair

ull INF;
ull MOD;
ull add(ull x, ull y) {
	x += y;
	if (x >= MOD) return x - MOD;
	return x;
}
ull sub(ull x, ull y) {
	if (x < y) x += MOD;
	return x - y;
}
ull mult(ull x, ull y) {
	return (x * y) % MOD;
}

const int N = 222;
ull C[N][N];
int d;
ull a[N];
ull dp[N][N];

ull solve(int n) {
	for (int i = 0; i <= min(n - 1, d); i++)
		for (int j = 0; j < n; j++)
			dp[i][j] = 0;
	dp[0][n - 1] = 1;
	for (int i = 0; i < min(n - 1, d); i++)
		for (int x = 0; x < n; x++) {
			dp[i][x] %= MOD;
			if (dp[i][x] == 0) continue;
			for (int y = 1; y <= x; y++) {
				dp[i + 1][x - y] += dp[i][x] * (a[y] * C[x - 1][y - 1] % MOD);
				if (dp[i + 1][x - y] > INF) dp[i + 1][x - y] %= MOD;
			}
		}
	ull res = 0;
	for (int i = 0; i <= min(n - 1, d); i++) {
		res += dp[i][0];
		if (res > INF) res %= MOD;
	}
	return res % MOD;
}

int main()
{
//	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);

	int n;
	scanf("%d%d%llu", &n, &d, &MOD);
	INF = 1;
	INF <<= 63;
	INF--;
	INF <<= 1;
	INF -= MOD * MOD;
	if (n == 1) {
		printf("0\n");
		return 0;
	}
	if (n == 2) {
		printf("%llu\n", 4 % MOD);
		return 0;
	}
	if (d == 1) {
		printf("0\n");
		return 0;
	}

	d--;
	for (int i = 0; i < N; i++)
		C[i][0] = C[i][i] = 1 % MOD;
	for (int i = 1; i < N; i++)
		for (int j = 1; j < i; j++)
			C[i][j] = add(C[i - 1][j - 1], C[i - 1][j]);
	a[0] = 1 % MOD;
	for (int i = 1; i < n; i++)
		a[i] = solve(i);
	d++;
	ll ans = solve(n);
	ans = (2 * (ans + MOD) - 1) % MOD;
	ans *= n * (n - 1) * 2;
	ans %= MOD;
	printf("%llu\n", ans);

	return 0;
}

#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <queue>
//#define ivorysi
using namespace std;
typedef long long ll;
int n,d,mod;
ll tree[205][205][205];
ll c[205][205];
int main() {
#ifdef ivorysi
	freopen("f1.in","r",stdin);
#endif
	scanf("%d%d%d",&n,&d,&mod);
	for(int i = 0 ; i <= n ; ++i) c[i][0] = 1;
	for(int i = 1 ; i <= n ; ++i) {
		for(int j = 1 ; j <= i ; ++j) {
			c[i][j] = c[i - 1][j] + c[i - 1][j - 1];
			c[i][j] %= mod;
		}
	}
	tree[1][1][0] = 1;
	for(int i = 1 ; i < n ; ++i) {
		for(int j = 1 ; j <= n ; ++j) {
			for(int k = 0 ; k <= d ; ++k) {
				tree[i + 1][j][k] = tree[i][j][k];
			}
		}
		ll tree_i = 0;
		for(int j = 0 ; j < d ; ++j) {
			tree_i += tree[i][i][j];
			tree_i %= mod;
		}
		ll ways = 1;
		for(int j = 1 ; j <= d  && i * j <= n; ++j) {
			ways = (ways * c[i * j - 1][i - 1]) % mod;
			for(int k = 1 ; k + i * j <= n ; ++k) {
				ll cc = ways * c[i * j + k - 1][k - 1];
				for(int h = 0 ; h + j <= d ; ++h) {
					tree[i + 1][i * j + k][h + j] += tree[i][k][h] * tree_i % mod * cc % mod;
					tree[i + 1][i * j + k][h + j] %= mod;
				}
			}
			ways = ways * tree_i % mod;
		}
	}
	ll tot_tr = 0;
	for(int i = 0 ; i <= n - 1 ; ++i) {
		for(int j = 0 ; j <= d ; ++j) {
			for(int k = 0 ; k + j<= d ; ++k) {
				if(k == 1) {
					continue;
				}
				tot_tr += tree[n][i + 1][j] * tree[n][n - i][k] % mod;
				tot_tr %= mod;
			}
		}
	}
	ll ans = 2 * n * (n - 1) % mod * tot_tr % mod;
	printf("%lld\n",ans);
	return 0;

}

#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <queue>
//#define ivorysi
using namespace std;
typedef long long ll;
int n,d,mod;
ll tree[205][205][205];
ll c[205][205];
int main() {
#ifdef ivorysi
	freopen("f1.in","r",stdin);
#endif
	scanf("%d%d%d",&n,&d,&mod);
	for(int i = 0 ; i <= n ; ++i) c[i][0] = 1;
	for(int i = 1 ; i <= n ; ++i) {
		for(int j = 1 ; j <= i ; ++j) {
			c[i][j] = c[i - 1][j] + c[i - 1][j - 1];
			c[i][j] %= mod;
		}
	}
	tree[1][1][0] = 1;
	for(int i = 1 ; i < n ; ++i) {
		for(int j = 1 ; j <= n ; ++j) {
			for(int k = 0 ; k <= d ; ++k) {
				tree[i + 1][j][k] = tree[i][j][k];
			}
		}
		ll tree_i = 0;
		for(int j = 0 ; j < d ; ++j) {
			tree_i += tree[i][i][j];
			tree_i %= mod;
		}
		ll ways = 1;
		for(int j = 1 ; j <= d  && i * j <= n; ++j) {
			ways = (ways * c[i * j - 1][i - 1]) % mod;
			for(int k = 1 ; k + i * j <= n ; ++k) {
				ll cc = ways * c[i * j + k - 1][k - 1];
				for(int h = 0 ; h + j <= d ; ++h) {
					tree[i + 1][i * j + k][h + j] += tree[i][k][h] * tree_i % mod * cc % mod;
					tree[i + 1][i * j + k][h + j] %= mod;
				}
			}
			ways = ways * tree_i % mod;
		}
	}
	ll tot_tr = 0;
	for(int i = 0 ; i <= n - 1 ; ++i) {
		for(int j = 0 ; j <= d ; ++j) {
			for(int k = 0 ; k + j<= d ; ++k) {
				if(k == 1) {
					continue;
				}
				tot_tr += tree[n][i + 1][j] * tree[n][n - i][k] % mod;
				tot_tr %= mod;
			}
		}
	}
	ll ans = 1LL * 2 * n * (n - 1) % mod * tot_tr % mod;
	printf("%lld\n",ans);
	return 0;
}

#include<bits/stdc++.h>
#define For(i,j,k) for (int i=j;i<=k;i++)
using namespace std;
#define N 205
int c[N][N],tr[N][N][N];
int mo,n,d;
int main(){
	scanf("%d%d%d",&n,&d,&mo);
	For(i,0,n){
		c[i][0]=1;
		For(j,1,i)
			c[i][j]=(c[i-1][j]+c[i-1][j-1])%mo;
	}
	tr[1][1][0]=1;
	/*tr[i][j][k]:已经加到i的树，有j个节点，根节点为k而且根到其他节点路径单调的方案数*/
	For(i,1,n-1){
		For(j,1,n) For(k,0,d)
			tr[i+1][j][k]=tr[i][j][k];
		int tri=0;
		For(j,0,d-1) tri=(tri+tr[i][i][j])%mo;
		int ways=1;
		For(j,1,min(n/i,d)){//选择j个
			ways=1ll*ways*c[i*j-1][i-1]%mo;
			For(k,1,n-i*j){//加到k上
				int cnt=1ll*ways*c[k+i*j-1][k-1]%mo;
				For(deg,0,d-j)
					tr[i+1][k+i*j][deg+j]=(tr[i+1][k+i*j][deg+j]+1ll*cnt*tr[i][k][deg]%mo*tri%mo)%mo;
			}
			ways=1ll*ways*tri%mo;
		}
	}
	int ans=0;
	For(i,0,n-1) For(j,0,d) For(k,0,d-j)
		if (k!=1) ans=(ans+1ll*tr[n][i+1][j]*tr[n][n-i][k]);
	printf("%d\n",2ll*n*(n-1)%mo*ans%mo);
}

#include<bits/stdc++.h>
#define For(i,j,k) for (int i=j;i<=k;i++)
using namespace std;
#define N 205
int c[N][N],tr[N][N][N];
int mo,n,d;
int main(){
	scanf("%d%d%d",&n,&d,&mo);
	For(i,0,n){
		c[i][0]=1;
		For(j,1,i)
			c[i][j]=(c[i-1][j]+c[i-1][j-1])%mo;
	}
	tr[1][1][0]=1;
	/*tr[i][j][k]:已经加到i的树，有j个节点，根节点为k而且根到其他节点路径单调的方案数*/
	For(i,1,n-1){
		For(j,1,n) For(k,0,d)
			tr[i+1][j][k]=tr[i][j][k];
		int tri=0;
		For(j,0,d-1) tri=(tri+tr[i][i][j])%mo;
		int ways=1;
		For(j,1,min(n/i,d)){//选择j个
			ways=1ll*ways*c[i*j-1][i-1]%mo;
			For(k,1,n-i*j){//加到k上
				int cnt=1ll*ways*c[k+i*j-1][k-1]%mo;
				For(deg,0,d-j)
					tr[i+1][k+i*j][deg+j]=(tr[i+1][k+i*j][deg+j]+1ll*cnt*tr[i][k][deg]%mo*tri%mo)%mo;
			}
			ways=1ll*ways*tri%mo;
		}
	}
	int ans=0;
	For(i,0,n-1) For(j,0,d) For(k,0,d-j)
		if (k!=1) ans=(ans+1ll*tr[n][i+1][j]*tr[n][n-i][k])%mo;
	printf("%d\n",2ll*n*(n-1)%mo*ans%mo);
}

#include<bits/stdc++.h>
#define For(i,j,k) for (int i=j;i<=k;i++)
using namespace std;
#define N 205
int c[N][N],tr[N][N][N];
int mo,n,d;
int main(){
	scanf("%d%d%d",&n,&d,&mo);
	For(i,0,n){
		c[i][0]=1;
		For(j,1,i)
			c[i][j]=(c[i-1][j]+c[i-1][j-1])%mo;
	}
	tr[1][1][0]=1;
	/*tr[i][j][k]:已经加到i的树，有j个节点，根节点为k而且根到其他节点路径单调的方案数*/
	For(i,1,n-1){
		For(j,1,n) For(k,0,d-1)
			tr[i+1][j][k]=tr[i][j][k];
		int tri=0;
		For(j,0,d-1) tri=(tri+tr[i][i][j])%mo;
		int ways=1;
		For(j,1,min(n/i,d)){//选择j个
			ways=1ll*ways*c[i*j-1][i-1]%mo;
			For(k,1,n-i*j){//加到k上
				int cnt=1ll*ways*c[k+i*j-1][k-1];
				For(deg,0,d-j)
					tr[i+1][k+i*j][deg+j]=(tr[i+1][k+i*j][deg+j]+1ll*cnt*tr[i][k][deg]%mo*tri%mo)%mo;
			}
			ways=1ll*ways*tri%mo;
		}
	}
	int ans=0;
	For(i,0,n-1) For(j,0,d) For(k,0,d-j)
		if (k!=1) ans=(ans+1ll*tr[n][i+1][j]*tr[n][n-i][k]);
	printf("%d\n",2ll*n*(n-1)%mo*ans%mo);
}

#include<bits/stdc++.h>
#define For(i,j,k) for (int i=j;i<=k;i++)
using namespace std;
#define N 205
int c[N][N],tr[N][N][N];
int mo,n,d;
int main(){
	scanf("%d%d%d",&n,&d,&mo);
	For(i,0,n){
		c[i][0]=1;
		For(j,1,i)
			c[i][j]=(c[i-1][j]+c[i-1][j-1])%mo;
	}
	tr[1][1][0]=1;
	/*tr[i][j][k]:已经加到i的树，有j个节点，根节点为k而且根到其他节点路径单调的方案数*/
	For(i,1,n-1){
		For(j,1,n) For(k,0,d)
			tr[i+1][j][k]=tr[i][j][k];
		int tri=0;
		For(j,0,d-1) tri=(tri+tr[i][i][j])%mo;
		int ways=1;
		For(j,1,min(n/i,d)){//选择j个
			ways=1ll*ways*c[i*j-1][i-1]%mo;
			For(k,1,n-i*j){//加到k上
				int cnt=1ll*ways*c[k+i*j-1][k-1];
				For(deg,0,d-j)
					tr[i+1][k+i*j][deg+j]=(tr[i+1][k+i*j][deg+j]+1ll*cnt*tr[i][k][deg]%mo*tri%mo)%mo;
			}
			ways=1ll*ways*tri%mo;
		}
	}
	int ans=0;
	For(i,0,n-1) For(j,0,d) For(k,0,d-j)
		if (k!=1) ans=(ans+1ll*tr[n][i+1][j]*tr[n][n-i][k]);
	printf("%d\n",2ll*n*(n-1)%mo*ans%mo);
}

#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")

#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/rope>

using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;

typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;

typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;

typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;

template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define F0R(i, a) for (int i = 0; i < (a); i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= (a); i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)
#define trav(a, x) for (auto& a : x)

#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound

#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)
#define rsz resize

int MOD = 1000000007; // 998244353
const ll INF = 1e18;
const int MX = 200005;
const ld PI = 4*atan((ld)1);

template<class T> void ckmin(T &a, T b) { a = min(a, b); }
template<class T> void ckmax(T &a, T b) { a = max(a, b); }

namespace input {
    template<class T> void re(complex<T>& x);
    template<class T1, class T2> void re(pair<T1,T2>& p);
    template<class T> void re(vector<T>& a);
    template<class T, size_t SZ> void re(array<T,SZ>& a);

    template<class T> void re(T& x) { cin >> x; }
    void re(double& x) { string t; re(t); x = stod(t); }
    void re(ld& x) { string t; re(t); x = stold(t); }
    template<class Arg, class... Args> void re(Arg& first, Args&... rest) {
        re(first); re(rest...);
    }

    template<class T> void re(complex<T>& x) { T a,b; re(a,b); x = cd(a,b); }
    template<class T1, class T2> void re(pair<T1,T2>& p) { re(p.f,p.s); }
    template<class T> void re(vector<T>& a) { F0R(i,sz(a)) re(a[i]); }
    template<class T, size_t SZ> void re(array<T,SZ>& a) { F0R(i,SZ) re(a[i]); }
}

using namespace input;

namespace output {
    template<class T1, class T2> void pr(const pair<T1,T2>& x);
    template<class T, size_t SZ> void pr(const array<T,SZ>& x);
    template<class T> void pr(const vector<T>& x);
    template<class T> void pr(const set<T>& x);
    template<class T1, class T2> void pr(const map<T1,T2>& x);

    template<class T> void pr(const T& x) { cout << x; }
    template<class Arg, class... Args> void pr(const Arg& first, const Args&... rest) {
        pr(first); pr(rest...);
    }

    template<class T1, class T2> void pr(const pair<T1,T2>& x) {
        pr("{",x.f,", ",x.s,"}");
    }
    template<class T> void prContain(const T& x) {
        pr("{");
        bool fst = 1; for (const auto& a: x) pr(!fst?", ":"",a), fst = 0; // const needed for vector<bool>
        pr("}");
    }
    template<class T, size_t SZ> void pr(const array<T,SZ>& x) { prContain(x); }
    template<class T> void pr(const vector<T>& x) { prContain(x); }
    template<class T> void pr(const set<T>& x) { prContain(x); }
    template<class T1, class T2> void pr(const map<T1,T2>& x) { prContain(x); }

    void ps() { pr("\n"); }
    template<class Arg> void ps(const Arg& first) {
        pr(first); ps(); // no space at end of line
    }
    template<class Arg, class... Args> void ps(const Arg& first, const Args&... rest) {
        pr(first," "); ps(rest...); // print w/ spaces
    }
}

using namespace output;

namespace io {
    void setIn(string s) { freopen(s.c_str(),"r",stdin); }
    void setOut(string s) { freopen(s.c_str(),"w",stdout); }
    void setIO(string s = "") {
        ios_base::sync_with_stdio(0); cin.tie(0); // fast I/O
        if (sz(s)) { setIn(s+".in"), setOut(s+".out"); } // for USACO
    }
}

using namespace io;

template<class T> T invGeneral(T a, T b) {
    a %= b; if (a == 0) return b == 1 ? 0 : -1;
    T x = invGeneral(b,a);
    return x == -1 ? -1 : ((1-(ll)b*x)/a+b)%b;
}

template<class T> struct modular {
    T val;
    explicit operator T() const { return val; }
    modular() { val = 0; }
    modular(const ll& v) {
        val = (-MOD <= v && v <= MOD) ? v : v % MOD;
        if (val < 0) val += MOD;
    }

    friend ostream& operator<<(ostream& os, const modular& a) { return os << a.val; }
    friend bool operator==(const modular& a, const modular& b) { return a.val == b.val; }
    friend bool operator!=(const modular& a, const modular& b) { return !(a == b); }
    friend bool operator<(const modular& a, const modular& b) { return a.val < b.val; }

    modular operator-() const { return modular(-val); }
    modular& operator+=(const modular& m) { if ((val += m.val) >= MOD) val -= MOD; return *this; }
    modular& operator-=(const modular& m) { if ((val -= m.val) < 0) val += MOD; return *this; }
    modular& operator*=(const modular& m) { val = (ll)val*m.val%MOD; return *this; }
    friend modular pow(modular a, ll p) {
        modular ans = 1; for (; p; p /= 2, a *= a) if (p&1) ans *= a;
        return ans;
    }
    friend modular inv(const modular& a) {
        auto i = invGeneral(a.val,MOD); assert(i != -1);
        return i;
    } // equivalent to return exp(b,MOD-2) if MOD is prime
    modular& operator/=(const modular& m) { return (*this) *= inv(m); }

    friend modular operator+(modular a, const modular& b) { return a += b; }
    friend modular operator-(modular a, const modular& b) { return a -= b; }
    friend modular operator*(modular a, const modular& b) { return a *= b; }

    friend modular operator/(modular a, const modular& b) { return a /= b; }
};

typedef modular<int> mi;
typedef pair<mi,mi> pmi;
typedef vector<mi> vmi;
typedef vector<pmi> vpmi;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int n,d;
mi ans;
mi dp[201][201], comb[201][201];

void solve() {
	F0R(i,d+1) dp[1][i] = 1;
	FOR(a,2,n+1) FOR(b,1,d+1) FOR(k,1,a)
		dp[a][b] += comb[a-2][k-1]*dp[a-k][b-1]*dp[k][d-1]; // a vertices, at most b adj

	FOR(i,1,n+1) FOR(j,1,n+1-i)
		ans += (dp[i][d-1]-dp[i][1]+dp[i][0])*(dp[j][d-1]-dp[j][1]+dp[j][0]);
	FOR(i,1,n+1) {
		int j = n+1-i;
		F0R(a,d+1) F0R(b,d+1-a) {
			if (a == 1 || b == 1) continue;
			ans += (dp[i][a]-(a?dp[i][a-1]:0))*(dp[j][b]-(b?dp[j][b-1]:0));
		}
	}
}

int main() {
    setIO(); re(n,d,MOD);
    comb[0][0] = 1;
    FOR(i,1,n+1) F0R(j,i+1) {
    	comb[i][j] = comb[i-1][j];
    	if (j) comb[i][j] += comb[i-1][j-1];
    }
    solve();
    // ps("HUH",ans);
    ans *= 2*n*(n-1);
    ps(ans);
}

/* stuff you should look for
    * int overflow, array bounds
    * special cases (n=1?), set tle
    * do smth instead of nothing and stay organized
*/

#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")

#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/rope>

using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;

typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;

typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;

typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;

template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define F0R(i, a) for (int i = 0; i < (a); i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= (a); i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)
#define trav(a, x) for (auto& a : x)

#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound

#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)
#define rsz resize

int MOD = 1000000007; // 998244353
const ll INF = 1e18;
const int MX = 200005;
const ld PI = 4*atan((ld)1);

template<class T> void ckmin(T &a, T b) { a = min(a, b); }
template<class T> void ckmax(T &a, T b) { a = max(a, b); }

namespace input {
    template<class T> void re(complex<T>& x);
    template<class T1, class T2> void re(pair<T1,T2>& p);
    template<class T> void re(vector<T>& a);
    template<class T, size_t SZ> void re(array<T,SZ>& a);

    template<class T> void re(T& x) { cin >> x; }
    void re(double& x) { string t; re(t); x = stod(t); }
    void re(ld& x) { string t; re(t); x = stold(t); }
    template<class Arg, class... Args> void re(Arg& first, Args&... rest) {
        re(first); re(rest...);
    }

    template<class T> void re(complex<T>& x) { T a,b; re(a,b); x = cd(a,b); }
    template<class T1, class T2> void re(pair<T1,T2>& p) { re(p.f,p.s); }
    template<class T> void re(vector<T>& a) { F0R(i,sz(a)) re(a[i]); }
    template<class T, size_t SZ> void re(array<T,SZ>& a) { F0R(i,SZ) re(a[i]); }
}

using namespace input;

namespace output {
    template<class T1, class T2> void pr(const pair<T1,T2>& x);
    template<class T, size_t SZ> void pr(const array<T,SZ>& x);
    template<class T> void pr(const vector<T>& x);
    template<class T> void pr(const set<T>& x);
    template<class T1, class T2> void pr(const map<T1,T2>& x);

    template<class T> void pr(const T& x) { cout << x; }
    template<class Arg, class... Args> void pr(const Arg& first, const Args&... rest) {
        pr(first); pr(rest...);
    }

    template<class T1, class T2> void pr(const pair<T1,T2>& x) {
        pr("{",x.f,", ",x.s,"}");
    }
    template<class T> void prContain(const T& x) {
        pr("{");
        bool fst = 1; for (const auto& a: x) pr(!fst?", ":"",a), fst = 0; // const needed for vector<bool>
        pr("}");
    }
    template<class T, size_t SZ> void pr(const array<T,SZ>& x) { prContain(x); }
    template<class T> void pr(const vector<T>& x) { prContain(x); }
    template<class T> void pr(const set<T>& x) { prContain(x); }
    template<class T1, class T2> void pr(const map<T1,T2>& x) { prContain(x); }

    void ps() { pr("\n"); }
    template<class Arg> void ps(const Arg& first) {
        pr(first); ps(); // no space at end of line
    }
    template<class Arg, class... Args> void ps(const Arg& first, const Args&... rest) {
        pr(first," "); ps(rest...); // print w/ spaces
    }
}

using namespace output;

namespace io {
    void setIn(string s) { freopen(s.c_str(),"r",stdin); }
    void setOut(string s) { freopen(s.c_str(),"w",stdout); }
    void setIO(string s = "") {
        ios_base::sync_with_stdio(0); cin.tie(0); // fast I/O
        if (sz(s)) { setIn(s+".in"), setOut(s+".out"); } // for USACO
    }
}

using namespace io;

template<class T> T invGeneral(T a, T b) {
    a %= b; if (a == 0) return b == 1 ? 0 : -1;
    T x = invGeneral(b,a);
    return x == -1 ? -1 : ((1-(ll)b*x)/a+b)%b;
}

template<class T> struct modular {
    T val;
    explicit operator T() const { return val; }
    modular() { val = 0; }
    modular(const ll& v) {
        val = (-MOD <= v && v <= MOD) ? v : v % MOD;
        if (val < 0) val += MOD;
    }

    friend ostream& operator<<(ostream& os, const modular& a) { return os << a.val; }
    friend bool operator==(const modular& a, const modular& b) { return a.val == b.val; }
    friend bool operator!=(const modular& a, const modular& b) { return !(a == b); }
    friend bool operator<(const modular& a, const modular& b) { return a.val < b.val; }

    modular operator-() const { return modular(-val); }
    modular& operator+=(const modular& m) { if ((val += m.val) >= MOD) val -= MOD; return *this; }
    modular& operator-=(const modular& m) { if ((val -= m.val) < 0) val += MOD; return *this; }
    modular& operator*=(const modular& m) { val = (ll)val*m.val%MOD; return *this; }
    friend modular pow(modular a, ll p) {
        modular ans = 1; for (; p; p /= 2, a *= a) if (p&1) ans *= a;
        return ans;
    }
    friend modular inv(const modular& a) {
        auto i = invGeneral(a.val,MOD); assert(i != -1);
        return i;
    } // equivalent to return exp(b,MOD-2) if MOD is prime
    modular& operator/=(const modular& m) { return (*this) *= inv(m); }

    friend modular operator+(modular a, const modular& b) { return a += b; }
    friend modular operator-(modular a, const modular& b) { return a -= b; }
    friend modular operator*(modular a, const modular& b) { return a *= b; }

    friend modular operator/(modular a, const modular& b) { return a /= b; }
};

typedef modular<int> mi;
typedef pair<mi,mi> pmi;
typedef vector<mi> vmi;
typedef vector<pmi> vpmi;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int n,d;
mi ans;
mi dp[201][201], comb[201][201];

void solve() {
	F0R(i,d+1) dp[1][i] = 1;
	FOR(a,2,n+1) FOR(b,1,d+1) FOR(k,1,a)
		dp[a][b] += comb[a-2][k-1]*dp[a-k][b-1]*dp[k][d-1]; // a vertices, at most b adj

	FOR(i,1,n+1) FOR(j,1,n+1-i)
		ans += (dp[i][d-1]-dp[i][1]+dp[i][0])*(dp[j][d-1]-dp[j][1]+dp[j][0]);
	FOR(i,1,n+1) {
		int j = n+1-i;
		F0R(a,d+1) F0R(b,d+1-a) {
			if (a == 1 || b == 1) continue;
			ans += (dp[i][a]-(a?dp[i][a-1]:0))*(dp[j][b]-(b?dp[j][b-1]:0));
		}
	}
}

int main() {
    setIO(); re(n,d,MOD);
	if (d == 1) {
		if (n == 2) ps(4%MOD);
		else ps(0);
		exit(0);
	}
    comb[0][0] = 1;
    FOR(i,1,n+1) F0R(j,i+1) {
    	comb[i][j] = comb[i-1][j];
    	if (j) comb[i][j] += comb[i-1][j-1];
    }
    solve();
    // ps("HUH",ans);
    ans *= 2*n*(n-1);
    ps(ans);
}

/* stuff you should look for
    * int overflow, array bounds
    * special cases (n=1?), set tle
    * do smth instead of nothing and stay organized
*/

#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")

#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/rope>

using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;

typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;

typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;

typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;

template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define F0R(i, a) for (int i = 0; i < (a); i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= (a); i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)
#define trav(a, x) for (auto& a : x)

#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound

#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)
#define rsz resize

int MOD = 1000000007; // 998244353
const ll INF = 1e18;
const int MX = 200005;
const ld PI = 4*atan((ld)1);

template<class T> void ckmin(T &a, T b) { a = min(a, b); }
template<class T> void ckmax(T &a, T b) { a = max(a, b); }

namespace input {
    template<class T> void re(complex<T>& x);
    template<class T1, class T2> void re(pair<T1,T2>& p);
    template<class T> void re(vector<T>& a);
    template<class T, size_t SZ> void re(array<T,SZ>& a);

    template<class T> void re(T& x) { cin >> x; }
    void re(double& x) { string t; re(t); x = stod(t); }
    void re(ld& x) { string t; re(t); x = stold(t); }
    template<class Arg, class... Args> void re(Arg& first, Args&... rest) {
        re(first); re(rest...);
    }

    template<class T> void re(complex<T>& x) { T a,b; re(a,b); x = cd(a,b); }
    template<class T1, class T2> void re(pair<T1,T2>& p) { re(p.f,p.s); }
    template<class T> void re(vector<T>& a) { F0R(i,sz(a)) re(a[i]); }
    template<class T, size_t SZ> void re(array<T,SZ>& a) { F0R(i,SZ) re(a[i]); }
}

using namespace input;

namespace output {
    template<class T1, class T2> void pr(const pair<T1,T2>& x);
    template<class T, size_t SZ> void pr(const array<T,SZ>& x);
    template<class T> void pr(const vector<T>& x);
    template<class T> void pr(const set<T>& x);
    template<class T1, class T2> void pr(const map<T1,T2>& x);

    template<class T> void pr(const T& x) { cout << x; }
    template<class Arg, class... Args> void pr(const Arg& first, const Args&... rest) {
        pr(first); pr(rest...);
    }

    template<class T1, class T2> void pr(const pair<T1,T2>& x) {
        pr("{",x.f,", ",x.s,"}");
    }
    template<class T> void prContain(const T& x) {
        pr("{");
        bool fst = 1; for (const auto& a: x) pr(!fst?", ":"",a), fst = 0; // const needed for vector<bool>
        pr("}");
    }
    template<class T, size_t SZ> void pr(const array<T,SZ>& x) { prContain(x); }
    template<class T> void pr(const vector<T>& x) { prContain(x); }
    template<class T> void pr(const set<T>& x) { prContain(x); }
    template<class T1, class T2> void pr(const map<T1,T2>& x) { prContain(x); }

    void ps() { pr("\n"); }
    template<class Arg> void ps(const Arg& first) {
        pr(first); ps(); // no space at end of line
    }
    template<class Arg, class... Args> void ps(const Arg& first, const Args&... rest) {
        pr(first," "); ps(rest...); // print w/ spaces
    }
}

using namespace output;

namespace io {
    void setIn(string s) { freopen(s.c_str(),"r",stdin); }
    void setOut(string s) { freopen(s.c_str(),"w",stdout); }
    void setIO(string s = "") {
        ios_base::sync_with_stdio(0); cin.tie(0); // fast I/O
        if (sz(s)) { setIn(s+".in"), setOut(s+".out"); } // for USACO
    }
}

using namespace io;

template<class T> T invGeneral(T a, T b) {
    a %= b; if (a == 0) return b == 1 ? 0 : -1;
    T x = invGeneral(b,a);
    return x == -1 ? -1 : ((1-(ll)b*x)/a+b)%b;
}

template<class T> struct modular {
    T val;
    explicit operator T() const { return val; }
    modular() { val = 0; }
    modular(const ll& v) {
        val = (-MOD <= v && v <= MOD) ? v : v % MOD;
        if (val < 0) val += MOD;
    }

    friend ostream& operator<<(ostream& os, const modular& a) { return os << a.val; }
    friend bool operator==(const modular& a, const modular& b) { return a.val == b.val; }
    friend bool operator!=(const modular& a, const modular& b) { return !(a == b); }
    friend bool operator<(const modular& a, const modular& b) { return a.val < b.val; }

    modular operator-() const { return modular(-val); }
    modular& operator+=(const modular& m) { if ((val += m.val) >= MOD) val -= MOD; return *this; }
    modular& operator-=(const modular& m) { if ((val -= m.val) < 0) val += MOD; return *this; }
    modular& operator*=(const modular& m) { val = (ll)val*m.val%MOD; return *this; }
    friend modular pow(modular a, ll p) {
        modular ans = 1; for (; p; p /= 2, a *= a) if (p&1) ans *= a;
        return ans;
    }
    friend modular inv(const modular& a) {
        auto i = invGeneral(a.val,MOD); assert(i != -1);
        return i;
    } // equivalent to return exp(b,MOD-2) if MOD is prime
    modular& operator/=(const modular& m) { return (*this) *= inv(m); }

    friend modular operator+(modular a, const modular& b) { return a += b; }
    friend modular operator-(modular a, const modular& b) { return a -= b; }
    friend modular operator*(modular a, const modular& b) { return a *= b; }

    friend modular operator/(modular a, const modular& b) { return a /= b; }
};

typedef modular<int> mi;
typedef pair<mi,mi> pmi;
typedef vector<mi> vmi;
typedef vector<pmi> vpmi;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int n,d;
mi ans;
mi dp[201][201], comb[201][201];

void solve() {
	F0R(i,d+1) dp[1][i] = 1;
	FOR(a,2,n+1) FOR(b,1,d+1) FOR(k,1,a) {
		dp[a][b] += comb[a-2][k-1]*dp[a-k][b-1]*dp[k][d-1];
		// ps("HUH",a,b,k,dp[a][b]);
	}
	// ps("??",dp[n][d]);
	ans = dp[n][d];
}

int main() {
    setIO(); re(n,d,MOD);
    comb[0][0] = 1;
    FOR(i,1,n+1) F0R(j,i+1) {
    	comb[i][j] = comb[i-1][j];
    	if (j) comb[i][j] += comb[i-1][j-1];
    }
    solve();
    ans = 2*ans;
    if (d > 1) ans -= 1;
    else if (d == 1 && n == 2) ans -= 1;
    // ps("HUH",ans);
    ans *= 2*n*(n-1);
    ps(ans);
}

/* stuff you should look for
    * int overflow, array bounds
    * special cases (n=1?), set tle
    * do smth instead of nothing and stay organized
*/

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

const int N=211;
typedef long long ll;
int n,K,mod,ans,g[N],f[N][N],C[N][N];
inline void reduce(int&x){x+=x>>31&mod;}
int main(){
	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	cin>>n>>K>>mod;
	for(int i=0;i<=n;++i){
		C[i][0]=1;
		for(int j=1;j<=i;++j)reduce(C[i][j]=C[i-1][j]-mod+C[i-1][j-1]);
	}
	f[1][0]=1;g[1]=1;
	for(int i=2;i<=n;++i)
		for(int j=1;j<=K;++j){
			for(int k=1;k<i;++k)
				f[i][j]=(f[i][j]+(ll)f[k][j-1]*g[i-k]%mod*C[i-2][k-1])%mod;
			reduce(g[i]+=f[i][j]-mod);
		}
	for(int i=1;i<=n;++i)
		for(int j=0;j<=K;++j)if(j!=1)
			for(int k=0;k<=K-j;++k)
				ans=(ans+(ll)f[i][j]*f[n+1-i][k])%mod;
	ans=(ll)2*n*(n-1)%mod*ans%mod;
	cout<<ans<<'\n';
	return 0;
}

#include<bits/stdc++.h>
const int N=210;
int n,d,mod,ans,C[N][N],dp[N][N],sum[N];
int main(){
#ifdef memset0
	freopen("1.in","r",stdin);
#endif
	scanf("%d%d%d",&n,&d,&mod);
	if(n==2){
		puts(d>=1?"4":"0");
		return 0;
	}
	for(int i=0;i<=n;i++){
		C[i][0]=1;
		for(int j=1;j<=i;j++)C[i][j]=((long long)C[i-1][j-1]+C[i-1][j])%mod;
	}
	for(int i=1;i<=n;i++){
		if(i==1){
			dp[1][0]=1;
		}else{
			dp[i][1]=sum[i-1];
			for(int j=2;j<i&&j<=d;j++)
				for(int k=1;k<i;k++){
					dp[i][j]=(dp[i][j]+(long long)dp[k][j-1]*sum[i-k]%mod*C[i-2][k-1])%mod;
				}
		}
		for(int j=0;j<d;j++)sum[i]=((long long)sum[i]+dp[i][j])%mod;
	}
	// for(int i=1;i<=n;i++)
	// 	for(int j=0;j<=d;j++)
	// 		printf("%d%c",dp[i][j]," \n"[j==d]);
	for(int i=1;i<=n;i++)
		for(int j=0;j<=d;j++)
			for(int k=0;j+k<=d;k++){
				ans=(ans+(long long)dp[i][j]*dp[n-i+1][k])%mod;
			}
	for(int i=1;i<=n;i++)
		for(int j=0;j<d;j++)
			for(int k=0;k<d;k++){
				ans=(ans-(long long)dp[i][j]*dp[n-i][k])%mod;
			}
	ans=(long long)ans*n%mod*(n-1)%mod;
	printf("%d\n",ans<0?ans+mod:ans);
}

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

using s64 = long long;

const int MaxN = 200;
const int MaxD = MaxN - 1;

int n, d, m;
int f[MaxN + 1][MaxD + 1];
int g[MaxN + 1][MaxD + 1];

int bin[MaxN + 1][MaxN + 1];

int main()
{
	cin >> n >> d >> m;

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

	f[1][0] = 1;
	for (int i = 0; i <= d; ++i)
		g[1][i] = 1;

	for (int i = 2; i <= n; ++i)
	{
		for (int j = 1; j <= d; ++j)
			for (int k = 1; k < i; ++k)
				f[i][j] = (f[i][j] + (s64)bin[i - 2][k - 1] * f[i - k][j - 1] % m * g[k][d - 1]) % m;

		for (int j = 1; j <= d; ++j)
			g[i][j] = (g[i][j - 1] + f[i][j]) % m;
	}

	int res = 0;
	for (int i = 0; i < n; ++i)
		for (int j = 0; j <= d; ++j)
			for (int k = 0; j + k <= d; ++k)
				if (k != 1)
					res = (res + (s64)f[i + 1][j] * f[n - i][k]) % m;

	cout << 2ll * n * (n - 1) % m * res % m << endl;

	return 0;
}

#include<iostream>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<stdio.h>
#include<vector>
#include<map>
#include<set>
using namespace std;
int dp[222][222],n,d,m,c[222][222];
int main()
{
	scanf("%d%d%d",&n,&d,&m);
	int i,j,s,p,q;
	memset(dp,0,sizeof(dp));
	dp[1][1]=1;
	for(i=0;i<=n;i++)
	  for(j=0;j<=i;j++)
	  {
  		  if(j==0||j==i)
  		     c[i][j]=1;
	      else
	         c[i][j]=(c[i-1][j-1]+c[i-1][j])%m;
  	 }
	for(i=1;i<=n;i++)
	   for(j=1;j<=d;j++)
	   {
   		   if(dp[i][j]==0)
   		      continue;
           if(j<d||i+1==n)
		       dp[i+1][1]=(dp[i+1][1]+dp[i][j])%m;
           for(s=1;s+i<=n;s++)
           	   dp[i+s][j+1]=(dp[i+s][j+1]+1LL*dp[i][j]*c[i+s-1][s-1])%m;
   	   }
    int ans=dp[n][1];
	if(ans!=0&&n>2)
	   ans=((ans<<1)-1)%m;
    printf("%d\n",1LL*ans*n%m*(n-1)%m*2%m);
	return 0;
}

#include<cstdio>
#include<algorithm>
#define fo(i,a,b) for(i=a;i<=b;i++)
using namespace std;
typedef long long ll;
const int maxn=200+10;
int f[maxn][maxn],s[maxn],c[maxn][maxn];
int i,j,k,l,t,n,m,ans,mo;
int main(){
	scanf("%d%d%d",&n,&m,&mo);
	c[0][0]=1;
	fo(i,1,n){
		c[i][0]=1;
		fo(j,1,i) c[i][j]=(c[i-1][j]+c[i-1][j-1])%mo;
	}
	f[1][0]=s[1]=1;
	fo(i,2,n){
		fo(k,1,m)
			fo(j,1,i-1)
				(f[i][k]+=(ll)f[i-j][k-1]*s[j]%mo*c[i-2][j-1]%mo)%=mo;
		fo(k,0,m-1) (s[i]+=f[i][k])%=mo;
	}
	fo(i,0,n-1)
		fo(j,0,m)
			fo(k,0,m-j)
				if (k!=1) (ans+=(ll)f[i+1][j]*f[n-i][k]%mo)%=mo;
	ans=(ll)ans*2%mo*n%mo*(n-1)%mo;
	(ans+=mo)%=mo;
	printf("%d\n",ans);
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld double
#define llu unsigned long long
#define rep(i,x,y)  for(ll i=x;i<y;++i)
#define For(i,x,y)  for(ll i=x;i<=y;++i)
#define FOr(i,x,y)  for(ll i=x;i>=y;--i)
#define pi acos(-1)
#define mk make_pair<ll,ll>
#define pa pair<ll,ll>
#define lf else if
#define max(x,y)    ((x)<(y)?(y):(x))
#define min(x,y)    ((x)<(y)?(x):(y))
#define sqr(x)		((x)*(x))
#define abs(x)		((x)>0?(x):-(x))
#define Mul(x,y)    (x=1LL*x*(y)%mod)
#define Add(x,y)    (x=(x+(y))%mod)
#define Max(x,y)	(x=(x<(y)?(y):x))
#define Min(x,y)	(x=(x>(y)?(y):x))
#define E(x) 		return writeln(x),0
#define p(x)		printf("~%d~\n",x)
#define pp(x,y)		printf("~~%d %d~~\n",x,y)
#define ppp(x,y,z)	printf("~~~%d %d %d~~~\n",x,y,z)
#define f_in(x)		freopen(x".in","r",stdin)
#define f_out(x) 	freopen(x".out","w",stdout)
#define open(x)		f_in(x),f_out(x)
#define fi first
#define se second
typedef complex<double> E;
namespace SHENZHEBEI{
#ifdef LOCAL
    struct _{_(){freopen("cf.in","r",stdin);}}_;
#endif
#define NEG 1
    inline char gc(){   return getchar();	}
#if NEG
    inline ll read(){    ll x=0,f=1; char ch=gc();   for (;!isdigit(ch);ch=gc()) if (ch=='-') f=-1;  for (;isdigit(ch);ch=gc())  x=x*10-48+ch;   return x*f; }
    inline void write(ll x){    if (x<0) putchar('-'),x=-x;  if (x>=10)   write(x/10);    putchar(x%10+'0');  }
#else
    inline ll read(){    ll x=0; char ch=gc();   for (;!isdigit(ch);ch=gc());    for (;isdigit(ch);ch=gc())  x=x*10-48+ch;   return x;   }
    inline void write(ll x){    if (x>=10)   write(x/10);    putchar(x%10+'0');  }
#endif
    inline char readchar(){ char ch=gc();   for(;isspace(ch);ch=gc());  return ch;  }
    inline ll readstr(char *s){ char ch=gc();   int cur=0;  for(;isspace(ch);ch=gc());      for(;!isspace(ch);ch=gc())  s[cur++]=ch;    s[cur]='\0';    return cur; }
    inline void writeln(ll x){  write(x);   puts("");   }
    inline ld getreal(){	static ld lbc;	scanf("%lf",&lbc);	return lbc;	}
}using namespace SHENZHEBEI;
const ll N=210;
ll m,n,d,mod,c[N][N],f[N][N],g[N];
int main(){
	n=read();	m=read();	mod=read();
	For(i,0,n){
		c[i][0]=c[i][i]=1;
		rep(j,1,i)c[i][j]=(c[i-1][j-1]+c[i-1][j])%mod;
	}f[1][0]=g[1]=1;
	For(i,2,n){
		rep(j,1,i)For(k,1,m)Add(f[i][j],f[i-j][k-1]*g[j]%mod*c[i-2][j-1]);//pp(i-j,k-1);
		For(j,0,m)Add(g[i],f[i][j]);
	}
	//For(i,0,10){
	//	For(j,0,10)printf("%lld ",f[i][j]);
	//	puts("");
	//}
	writeln(2ll*n*(n-1)%mod*g[n]%mod);
}
/*
*/

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld double
#define llu unsigned long long
#define rep(i,x,y)  for(ll i=x;i<y;++i)
#define For(i,x,y)  for(ll i=x;i<=y;++i)
#define FOr(i,x,y)  for(ll i=x;i>=y;--i)
#define pi acos(-1)
#define mk make_pair<ll,ll>
#define pa pair<ll,ll>
#define lf else if
#define max(x,y)    ((x)<(y)?(y):(x))
#define min(x,y)    ((x)<(y)?(x):(y))
#define sqr(x)		((x)*(x))
#define abs(x)		((x)>0?(x):-(x))
#define Mul(x,y)    (x=1LL*x*(y)%mod)
#define Add(x,y)    (x=(x+(y))%mod)
#define Max(x,y)	(x=(x<(y)?(y):x))
#define Min(x,y)	(x=(x>(y)?(y):x))
#define E(x) 		return writeln(x),0
#define p(x)		printf("~%d~\n",x)
#define pp(x,y)		printf("~~%d %d~~\n",x,y)
#define ppp(x,y,z)	printf("~~~%d %d %d~~~\n",x,y,z)
#define f_in(x)		freopen(x".in","r",stdin)
#define f_out(x) 	freopen(x".out","w",stdout)
#define open(x)		f_in(x),f_out(x)
#define fi first
#define se second
typedef complex<double> E;
namespace SHENZHEBEI{
#ifdef LOCAL
    struct _{_(){freopen("cf.in","r",stdin);}}_;
#endif
#define NEG 1
    inline char gc(){   return getchar();	}
#if NEG
    inline ll read(){    ll x=0,f=1; char ch=gc();   for (;!isdigit(ch);ch=gc()) if (ch=='-') f=-1;  for (;isdigit(ch);ch=gc())  x=x*10-48+ch;   return x*f; }
    inline void write(ll x){    if (x<0) putchar('-'),x=-x;  if (x>=10)   write(x/10);    putchar(x%10+'0');  }
#else
    inline ll read(){    ll x=0; char ch=gc();   for (;!isdigit(ch);ch=gc());    for (;isdigit(ch);ch=gc())  x=x*10-48+ch;   return x;   }
    inline void write(ll x){    if (x>=10)   write(x/10);    putchar(x%10+'0');  }
#endif
    inline char readchar(){ char ch=gc();   for(;isspace(ch);ch=gc());  return ch;  }
    inline ll readstr(char *s){ char ch=gc();   int cur=0;  for(;isspace(ch);ch=gc());      for(;!isspace(ch);ch=gc())  s[cur++]=ch;    s[cur]='\0';    return cur; }
    inline void writeln(ll x){  write(x);   puts("");   }
    inline ld getreal(){	static ld lbc;	scanf("%lf",&lbc);	return lbc;	}
}using namespace SHENZHEBEI;
const ll N=210;
ll m,n,d,mod,c[N][N],f[N][N],g[N],ans;
int main(){
	n=read();	m=read();	mod=read();
	For(i,0,n){
		c[i][0]=1;
		For(j,1,i)c[i][j]=(c[i-1][j-1]+c[i-1][j])%mod;
	}f[1][0]=g[1]=1;
	For(i,2,n){
		rep(j,1,i)For(k,1,m)Add(f[i][j],f[i-j][k-1]*g[j]%mod*c[i-2][j-1]);//pp(i-j,k-1);
		For(j,0,m-1)Add(g[i],f[i][j]);
	}
	For(i,0,m)For(j,0,m-i)if (j!=1)For(k,1,n)Add(ans,f[k][i]*f[n-k+1][j]);
	writeln(2ll*n*(n-1)%mod*ans%mod);
}
/*

*/

#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <cassert>
#include <string.h>
//#include <unordered_set>
//#include <unordered_map>
//#include <bits/stdc++.h>

#define MP(A,B) make_pair(A,B)
#define PB(A) push_back(A)
#define SIZE(A) ((int)A.size())
#define LEN(A) ((int)A.length())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define fi first
#define se second

using namespace std;

template<typename T>inline bool upmin(T &x,T y) { return y<x?x=y,1:0; }
template<typename T>inline bool upmax(T &x,T y) { return x<y?x=y,1:0; }

typedef long long ll;
typedef unsigned long long ull;
typedef long double lod;
typedef pair<int,int> PR;
typedef vector<int> VI;

const lod eps=1e-11;
const lod pi=acos(-1);
const int oo=1<<30;
const ll loo=1ll<<62;
const int MAXN=600005;
const int INF=0x3f3f3f3f;//1061109567
/*--------------------------------------------------------------------*/
inline int read()
{
	int f=1,x=0; char c=getchar();
	while (c<'0'||c>'9') { if (c=='-') f=-1; c=getchar(); }
	while (c>='0'&&c<='9') { x=(x<<3)+(x<<1)+(c^48); c=getchar(); }
	return x*f;
}
ll f[205][205],s[205],C[205][205],n,d,mods;
ll upd(ll x,ll y) { return x+y>=mods?x+y-mods:x+y; }
void Init()
{
	for (int i=0;i<=n;i++) C[i][0]=C[i][i]=1;
	for (int i=2;i<=n;i++)
		for (int j=1;j<i;j++) C[i][j]=upd(C[i-1][j],C[i-1][j-1]);
}
int main()
{
	n=read(),d=read(),mods=read();
	Init();
	f[1][0]=s[1]=1;
	for (int i=2;i<=n;i++)
		for (int j=1;j<=d;j++)
		{
			for (int k=1;k<=i-j;k++)
				f[i][j]=upd(f[i][j],f[i-k][j-1]*s[k]%mods*C[i-2][k-1]%mods);
			if (j!=d) s[i]=upd(s[i],f[i][j]);
		}
	ll ans=0;
	for (int i=1;i<=n;i++)
		for (int j=0;j<=d;j++)
			for (int k=0;k<=d;k++)
				if (k!=1) ans=upd(ans,f[i][j]*f[n-i+1][k]%mods);
	printf("%lld\n",ans*n%mods*(n-1)%mods*2%mods);
	return 0;
}

#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<algorithm>
#include<cmath>
#include<queue>
#include<vector>
#include<ctime>
#include<map>
#include<bitset>
#include<set>
#include<assert.h>
//#include<chrono>
//#include<random>
#include<iostream>
#define LL long long
#define mp(x,y) make_pair(x,y)
#define pll pair<long long,long long>
#define pii pair<int,int>
#define SZ(x) ((int)x.size())
#define VI vector<int>
using namespace std;
//mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
inline LL read()
{
	LL f=1,x=0;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
LL stack[20];
template<typename T>inline void write(T x)
{
	if(x<0){putchar('-');x=-x;}
    if(!x){putchar('0');return;}
    LL top=0;
    while(x)stack[++top]=x%10,x/=10;
    while(top)putchar(stack[top--]+'0');
}
template<typename T>inline void pr1(T x){write(x);putchar(' ');}
template<typename T>inline void pr2(T x){write(x);putchar('\n');}
template<typename T>inline void chkmin(T &x,T y){x=x<y?x:y;}
template<typename T>inline void chkmax(T &x,T y){x=x>y?x:y;}
const LL MAXN=205;
LL n,D,mod,opt;
void ad(LL &x,LL y){x+=y;if(x>=mod)x-=mod;}
void dl(LL &x,LL y){x-=y;if(x<0)x+=mod;}
LL coef[MAXN][MAXN],C[MAXN][MAXN];
//n=i j subtrees
//coef[i][1]
void getcoef()
{
	coef[0][0]=coef[1][1]=1;
	for(LL i=1;i<=n;i++)
	{
		for(LL j=1;j<=i;j++)
			for(LL k=1;k<i;k++)
				ad(coef[i][j],1LL*coef[i-k][j-1]*coef[k][1]%mod*C[i-1][k-1]%mod);
		LL S=0;
		for(LL j=1;j<D;j++)ad(S,coef[i][j]);
		ad(coef[i+1][1],S);
	}
}
int main()
{
//	freopen("b.in","r",stdin);
//	freopen("b.out","w",stdout);
	#ifdef Rose
		double BeginJudgeTime=clock();
	#endif
	n=read();D=read();mod=read();
//	if(!opt)
//	{
//		if(n<=2)return pr2(1%mod),0;
//		else if(D>1)return pr2(1%mod),0;
//		else return pr2(0),0;
//	}
	if(D==1)
	{
		if(n<=2)return pr2(1%mod),0;
		else return pr2(0),0;
	}
	for(LL i=0;i<MAXN;i++)
	{
		C[i][0]=1;
		for(LL j=1;j<=i;j++)C[i][j]=C[i-1][j],ad(C[i][j],C[i-1][j-1]);
	}
	getcoef();LL ans=0;
	for(LL i=n;i>=1;i--)
	{
		for(LL j=0;j<=n-i;j++)
			for(LL k=2;k+j<=D;k++)
				ad(ans,1LL*coef[i-1][k]*coef[n-i][j]%mod);
	}
	for(int i=1;i<=D;i++)ad(ans,coef[n-1][i]);
	pr2(ans%mod);
	#ifdef Rose
		double EndJudgeTime=clock();
		cerr<<"JudgeTime is"<<" ";
		cerr<<(EndJudgeTime-BeginJudgeTime)/CLOCKS_PER_SEC<<endl;
	#endif
	return 0;
}

#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<algorithm>
#include<cmath>
#include<queue>
#include<vector>
#include<ctime>
#include<map>
#include<bitset>
#include<set>
#include<assert.h>
//#include<chrono>
//#include<random>
#include<iostream>
#define LL long long
#define mp(x,y) make_pair(x,y)
#define pll pair<long long,long long>
#define pii pair<int,int>
#define SZ(x) ((int)x.size())
#define VI vector<int>
using namespace std;
//mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
inline LL read()
{
	LL f=1,x=0;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
LL stack[20];
template<typename T>inline void write(T x)
{
	if(x<0){putchar('-');x=-x;}
    if(!x){putchar('0');return;}
    LL top=0;
    while(x)stack[++top]=x%10,x/=10;
    while(top)putchar(stack[top--]+'0');
}
template<typename T>inline void pr1(T x){write(x);putchar(' ');}
template<typename T>inline void pr2(T x){write(x);putchar('\n');}
template<typename T>inline void chkmin(T &x,T y){x=x<y?x:y;}
template<typename T>inline void chkmax(T &x,T y){x=x>y?x:y;}
const LL MAXN=205;
LL n,D,mod,opt;
void ad(LL &x,LL y){x+=y;if(x>=mod)x-=mod;}
void dl(LL &x,LL y){x-=y;if(x<0)x+=mod;}
LL coef[MAXN][MAXN],C[MAXN][MAXN];
//n=i j subtrees
//coef[i][1]
void getcoef()
{
	coef[0][0]=coef[1][1]=1;
	for(LL i=1;i<=n;i++)
	{
		for(LL j=1;j<=i;j++)
			for(LL k=1;k<i;k++)
				ad(coef[i][j],1LL*coef[i-k][j-1]*coef[k][1]%mod*C[i-1][k-1]%mod);
		LL S=0;
		for(LL j=1;j<D;j++)ad(S,coef[i][j]);
		ad(coef[i+1][1],S);
	}
}
int main()
{
//	freopen("b.in","r",stdin);
//	freopen("b.out","w",stdout);
	#ifdef Rose
		double BeginJudgeTime=clock();
	#endif
	n=read();D=read();mod=read();
//	if(!opt)
//	{
//		if(n<=2)return pr2(1%mod),0;
//		else if(D>1)return pr2(1%mod),0;
//		else return pr2(0),0;
//	}
	if(D==1)
	{
		if(n<=2)return pr2(1%mod),0;
		else return pr2(0),0;
	}
	for(LL i=0;i<MAXN;i++)
	{
		C[i][0]=1;
		for(LL j=1;j<=i;j++)C[i][j]=C[i-1][j],ad(C[i][j],C[i-1][j-1]);
	}
	getcoef();LL ans=0;
	for(LL i=n;i>=1;i--)
	{
		for(LL j=0;j<=n-i;j++)
			for(LL k=2;k+j<=D;k++)
				ad(ans,1LL*coef[i-1][k]*coef[n-i][j]%mod);
	}
	for(int i=1;i<=D;i++)ad(ans,coef[n-1][i]);
	pr2(1LL*ans*2%mod*C[n][2]%mod);
	#ifdef Rose
		double EndJudgeTime=clock();
		cerr<<"JudgeTime is"<<" ";
		cerr<<(EndJudgeTime-BeginJudgeTime)/CLOCKS_PER_SEC<<endl;
	#endif
	return 0;
}

#include <bits/stdc++.h>
#define pb push_back

using namespace std;
typedef long long INT;
typedef pair <int, int> pii;
typedef vector <int> VI;

#define NN 210
int c[NN][NN], tree[NN][NN], sum[NN][NN];
int main (){
#ifndef ONLINE_JUDGE
	freopen ("in.in", "r", stdin);
	freopen ("out.out", "w", stdout);
#endif

	int n, d, m;
	cin >> n >> d >> m;

	for(int i=0; i<=n; i++) for(int j=c[i][0]=c[i][i]=1; j<i; j++) c[i][j]=(c[i-1][j-1]+c[i-1][j])%m;

	tree[1][0]=1;
	for(int i=0; i<=d; i++) sum[1][i]=1;

	for(int i=2; i<=n; i++){
		for(int j=1; j<i; j++) for(int k=0; k<d; k++){
			tree[i][k+1]=((INT)c[i-2][j-1]*sum[j][d-1]%m*tree[i-j][k]+tree[i][k+1])%m;
		}
		for(int j=1; j<=d; j++) sum[i][j]=(sum[i][j-1]+tree[i][j])%m;
	}

	int ans=0;
	for(int i=1; i<=n; i++) for(int j=0; j<=d; j++) for(int k=0; k<=d; k++) if(k!=1){
		ans=((INT)tree[i][j]*tree[n-i+1][k]+ans)%m;
	}

	cout << (2LL*n*(n-1)*ans%m) << endl;

	return 0;
}

#include <bits/stdc++.h>
#define pb push_back

using namespace std;
typedef long long INT;
typedef pair <int, int> pii;
typedef vector <int> VI;

#define NN 210
int c[NN][NN], tree[NN][NN], sum[NN][NN];
int main (){
#ifndef ONLINE_JUDGE
	freopen ("in.in", "r", stdin);
	freopen ("out.out", "w", stdout);
#endif

	int n, d, m;
	cin >> n >> d >> m;

	for(int i=0; i<=n; i++) for(int j=c[i][0]=c[i][i]=1; j<i; j++) c[i][j]=((INT)c[i-1][j-1]+c[i-1][j])%m;

	tree[1][0]=1;
	for(int i=0; i<=d; i++) sum[1][i]=1;

	for(int i=2; i<=n; i++){
		for(int j=1; j<i; j++) for(int k=0; k<d; k++){
			tree[i][k+1]=((INT)c[i-2][j-1]*sum[j][d-1]%m*tree[i-j][k]+tree[i][k+1])%m;
		}
		for(int j=1; j<=d; j++) sum[i][j]=((INT)sum[i][j-1]+tree[i][j])%m;
	}

	int ans=0;
	for(int i=1; i<=n; i++) for(int j=0; j<=d; j++) for(int k=0; k<=d; k++) if(k!=1){
		ans=((INT)tree[i][j]*tree[n-i+1][k]+ans)%m;
	}

	cout << (2LL*n*(n-1)*ans%m) << endl;

	return 0;
}

# include <iostream>
# include <sstream>
# include <cstdio>
# include <cstdlib>
# include <algorithm>
# include <string>
# include <cstring>
# include <cmath>
# include <stack>
# include <queue>
# include <vector>
# include <list>
# include <map>
# include <set>
# include <deque>
# include <iterator>
# include <functional>
# include <bitset>
# include <climits>
# include <ctime>
using namespace std;
#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<(b)?(a):(b))
#define odd(x) ((x)&1)
#define sqr(x) ((x)*(x))
#define mp make_pair
#define pb push_back
#define fir first
#define sec second
#define all(x) (x).begin(),(x).end()
#define mem(a,x) memset(a,x,sizeof(a))
#define rep(i,a,b) for (int i=(a); i<=(b); ++i)
#define per(i,a,b) for (int i=(a); i>=(b); --i)
#define rep_it(it,x) for (__typeof((x).begin()) it=(x).begin(); it!=(x).end(); it++)
#define ____ puts("\n_______________\n\n")
#define debug(x) ____; cout<< #x << " => " << (x) << endl
#define debug_pair(x) cout<<"\n{ "<<(x).fir<<" , "<<(x).sec<<" }\n"
#define debug_arr(x,n) ____; cout<<#x<<":\n"; rep(i,0,n) cout<<#x<<"["<<(i)<<"] => "<<x[i]<<endl
#define debug_arr2(x,n,m) ____; cout<<#x<<":\n"; rep(i,0,n) rep(j,0,m) cout<<#x<<"["<<(i)<<"]["<<(j)<<"]= "<<x[i][j]<<((j==m)?"\n\n":"    ")
#define debug_set(x) ____; cout<<#x<<": \n"; rep_it(it,x) cout<<(*it)<<" "; cout<<endl
#define debug_map(x) ____; cout<<#x<<": \n"; rep_it(it,x) debug_pair(*it)
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef vector<int> vi;
const int oo = /*2 * 1000 * 1000 * 1000*/0x3f3f3f3f;
const ll ooo=9223372036854775807ll;
const int _cnt = 1000 * 1000 + 7;
const int _p = 1000 * 1000 * 1000 + 7;
const int N=100005;
const double PI=acos(-1.0);
const double eps=1e-9;
int o(int x) { return x%_p; }
int gcd(int a, int b) { return b ? gcd(b, a%b) : a; }
int lcm(int a, int b) { return a / gcd(a, b)*b; }

void file_put() {
    freopen("filename.in", "r", stdin);
    freopen("filename.out", "w", stdout);
}

int dp[205][205],s[205],C[205][205],n,d,m,ans=0;

int main() {
    //file_put();

    scanf("%d%d%d",&n,&d,&m);
    C[0][0]=dp[1][0]=s[1]=1;
    rep(i,1,n+2) {
    	C[i][0]=1;
    	rep(j,1,i) C[i][j]=(C[i-1][j]+C[i-1][j-1])%m;
	}
	rep(i,2,n) {
		rep(j,1,d) rep(k,1,i-j) (dp[i][j]+=(ll)dp[i-k][j-1]*s[k]%m*C[i-2][k-1]%m)%m;
		rep(j,1,d-1) (s[i]+=dp[i][j])%m;
	}
	rep(i,0,n-1) rep(j,0,d) rep(k,0,d) {
		if (j+k>d) break;
		if (k==1) continue;
		(ans+=(ll)dp[i+1][j]*dp[n-i][k]%m)%m;
	}
	printf("%d\n",(ll)2*n*(n-1)*ans%m);

    return 0;
}

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

const int MAXN = 205;

int N, D, M;
int dp[MAXN][MAXN][MAXN];
int pref[MAXN][MAXN];
int choose[MAXN][MAXN];
int pre[MAXN][MAXN];

void load() {
	scanf("%d%d%d", &N, &D, &M);
}

inline int add(int x, int y) {
	x += y;
	if (x >= M)
		x -= M;
	else if (x < 0)
		x += M;
	return x;
}

inline int mul(int x, int y) {
	return (long long)x * y % M;
}

int solve() {
	if (D == 1)
		return N == 2 ? 4 % M : 0;

	choose[0][0] = 1;
	for (int i = 1; i <= N; i++) {
		choose[i][0] = 1;
		for (int j = 1; j <= i; j++)
			choose[i][j] = add(choose[i - 1][j - 1], choose[i - 1][j]);
	}

	pref[1][0] = 1;
	for (int i = 1; i <= N; i++) {
		dp[i][0][0] = 1;
		for (int j = 1; j <= min(D, i - 1); j++)
			for (int k = 1; k < i; k++)
				for (int l = 1; l <= k; l++)
					dp[i][j][k] = add(dp[i][j][k], mul(dp[i][j - 1][k - l], pre[k][l]));
		for (int j = 1; j <= D; j++)
			pref[i][j] = add(pref[i][j - 1], dp[i][j][i - 1]);
		for (int k = i; k < N; k++)
			pre[k][i] = mul(choose[k - 1][i - 1], pref[i][D - 1]);
	}

	int sol = 0;
	for (int i = 1; i <= N; i++)
		for (int j = 2; j < D; j++)
			for (int k = 1; j + k <= D; k++)
				sol = add(sol, mul(dp[i][j][i - 1], dp[N - i + 1][k][N - i]));

	for (int i = 1; i <= D; i++)
		sol = add(sol, dp[N][i][N - 1]);

	for (int i = 2; i <= D; i++)
		sol = add(sol, dp[N][i][N - 1]);

	return mul(sol, mul(2, mul(N, N - 1)));
}

int main() {
	load();
	printf("%d\n", solve());
	return 0;
}

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

const int MAXN = 205;

int N, D, M;
int dp[MAXN][MAXN][MAXN];
int pref[MAXN][MAXN];
int tot[MAXN];
int choose[MAXN][MAXN];

void load() {
	scanf("%d%d%d", &N, &D, &M);
}

inline int add(int x, int y) {
	x += y;
	if (x >= M)
		x -= M;
	else if (x < 0)
		x += M;
	return x;
}

inline int mul(int x, int y) {
	return (long long)x * y % M;
}

int solve() {
	if (D == 1)
		return N == 2 ? 4 % M : 0;

	choose[0][0] = 1;
	for (int i = 1; i <= N; i++) {
		choose[i][0] = 1;
		for (int j = 1; j <= i; j++)
			choose[i][j] = add(choose[i - 1][j - 1], choose[i - 1][j]);
	}

	pref[1][0] = 1;
	for (int i = 1; i <= N; i++) {
		dp[i][0][0] = 1;
		for (int j = 1; j < D; j++) {
			for (int k = 1; k < i; k++)
				for (int l = 1; l <= k; l++)
					dp[i][j][k] = add(dp[i][j][k], mul(dp[i][j - 1][k - l], mul(choose[k][l], pref[l][D - 1])));
			pref[i][j] = add(pref[i][j - 1], dp[i][j][i - 1]);
		}
		tot[i] = add(pref[i][D - 1], -pref[i][1]);
	}
	tot[1] = 1;

	int sol = 0;
	for (int i = 1; i <= N; i++)
		for (int j = i + 1; j <= N; j++)
			if (i > 1 || j < N)
				sol = add(sol, mul(tot[i], tot[N - j + 1]));

	for (int i = 2; i < N; i++)
		for (int j = 2; j < D; j++)
			for (int k = 2; k < D; k++)
				if (j + k <= D)
					sol = add(sol, mul(dp[i + 1][j][i], dp[N - i + 1][k][N - i]));

	int pot = 1;
	for (int i = 1; i < N; i++)
		pot = mul(pot, 2);

	sol = add(sol, add(pot, -1));

	return mul(sol, mul(2, mul(N, N - 1)));
}

int main() {
	load();
	printf("%d\n", solve());
	return 0;
}