#include <bits/stdc++.h>
using namespace std;
namespace mine {
long long qread() {
  long long 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(long long num) {
  if (num < 0) putchar('-'), num = -num;
  if (num >= 10) write(num / 10);
  putchar('0' + num % 10);
}
void write1(long long num) {
  write(num);
  putchar(' ');
}
void write2(long long 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;
}
long long gcd(long long x, long long y) { return y ? gcd(y, x % y) : x; }
bool IN(long long x, long long l, long long r) { return l <= x and x <= r; }
void GG() {
  puts("No");
  exit(0);
}
const double 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);
}
long long qpower(long long x, long long e, int mod = MOD) {
  long long ans = 1;
  while (e) {
    if (e & 1) ans = ans * x % mod;
    x = x * x % mod;
    e >>= 1;
  }
  return ans;
}
long long invm(long long x) { return qpower(x, MOD - 2); }
const int N = 1e3 + 10;
long long C[N][N];
long long f[N], dp[N][N];
void main() {
  int n = qread(), D = qread(), mod = qread();
  C[0][0] = 1;
  for (int i = (1), I = (n); i <= I; i++) {
    C[i][0] = 1;
    for (int j = (1), I = (i); j <= I; j++)
      C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]) % mod;
  }
  dp[1][0] = f[1] = 1;
  for (int siz = (2), I = (n); siz <= I; siz++)
    for (int d = (1), I = (D); d <= I; d++) {
      for (int lst = (1), I = (siz - 1); lst <= I; lst++)
        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;
    }
  long long ans = (f[n] + mod - dp[n][1]) * 2 % mod;
  for (int s = (1), I = (n - 1); s <= I; s++)
    for (int d1 = (2), I = (D); d1 <= I; d1++)
      for (int d2 = (2), I = (D); d2 <= I; d2++)
        if (d1 + d2 <= D) (ans += dp[s][d1] * dp[n - s + 1][d2]) %= mod;
  for (int s = (1), I = (n - 1); s <= I; s++)
    for (int d = (0), I = (D - 1); d <= I; d++)
      if (d != 1) (ans += dp[s][d] * dp[n - s + 1][1]) %= mod;
  ans = ans * (n * (n - 1) / 2) % mod * 4 % mod;
  write((ans + mod) % mod);
}
};  // namespace mine
signed main() {
  mine::main();
  ;
}

### Prompt

Your challenge is to write a CPP solution to the following problem:

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.

Input

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

Output

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

Examples

Input

2 1 1000000007


Output

4


Input

3 1 250


Output

0


Input

3 2 100


Output

36

Note

In 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. 

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
namespace mine {
long long qread() {
  long long 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(long long num) {
  if (num < 0) putchar('-'), num = -num;
  if (num >= 10) write(num / 10);
  putchar('0' + num % 10);
}
void write1(long long num) {
  write(num);
  putchar(' ');
}
void write2(long long 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;
}
long long gcd(long long x, long long y) { return y ? gcd(y, x % y) : x; }
bool IN(long long x, long long l, long long r) { return l <= x and x <= r; }
void GG() {
  puts("No");
  exit(0);
}
const double 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);
}
long long qpower(long long x, long long e, int mod = MOD) {
  long long ans = 1;
  while (e) {
    if (e & 1) ans = ans * x % mod;
    x = x * x % mod;
    e >>= 1;
  }
  return ans;
}
long long invm(long long x) { return qpower(x, MOD - 2); }
const int N = 1e3 + 10;
long long C[N][N];
long long f[N], dp[N][N];
void main() {
  int n = qread(), D = qread(), mod = qread();
  C[0][0] = 1;
  for (int i = (1), I = (n); i <= I; i++) {
    C[i][0] = 1;
    for (int j = (1), I = (i); j <= I; j++)
      C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]) % mod;
  }
  dp[1][0] = f[1] = 1;
  for (int siz = (2), I = (n); siz <= I; siz++)
    for (int d = (1), I = (D); d <= I; d++) {
      for (int lst = (1), I = (siz - 1); lst <= I; lst++)
        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;
    }
  long long ans = (f[n] + mod - dp[n][1]) * 2 % mod;
  for (int s = (1), I = (n - 1); s <= I; s++)
    for (int d1 = (2), I = (D); d1 <= I; d1++)
      for (int d2 = (2), I = (D); d2 <= I; d2++)
        if (d1 + d2 <= D) (ans += dp[s][d1] * dp[n - s + 1][d2]) %= mod;
  for (int s = (1), I = (n - 1); s <= I; s++)
    for (int d = (0), I = (D - 1); d <= I; d++)
      if (d != 1) (ans += dp[s][d] * dp[n - s + 1][1]) %= mod;
  ans = ans * (n * (n - 1) / 2) % mod * 4 % mod;
  write((ans + mod) % mod);
}
};  // namespace mine
signed main() {
  mine::main();
  ;
}

```