Problem: A tree is a connected graph without cycles.

Two trees, consisting of n vertices each, are called isomorphic if there exists a permutation p: {1, ..., n} → {1, ..., n} such that the edge (u, v) is present in the first tree if and only if the edge (pu, pv) is present in the second tree.

Vertex of the tree is called internal if its degree is greater than or equal to two.

Count the number of different non-isomorphic trees, consisting of n vertices, such that the degree of each internal vertex is exactly d. Print the answer over the given prime modulo mod.

Input

The single line of the input contains three integers n, d and mod (1 ≤ n ≤ 1000, 2 ≤ d ≤ 10, 108 ≤ mod ≤ 109) — the number of vertices in the tree, the degree of internal vertices and the prime modulo.

Output

Print the number of trees over the modulo mod.

Examples

Input

5 2 433416647


Output

1


Input

10 3 409693891


Output

2


Input

65 4 177545087


Output

910726

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
template <typename T>
inline void read(T &x) {
  x = 0;
  char c = getchar();
  while (!isdigit(c)) c = getchar();
  while (isdigit(c)) x = x * 10 + (c ^ 48), c = getchar();
}
using namespace std;
int n, d, P;
inline void ADD(int &a, long long b) {
  a += b;
  if (a >= P) a -= P;
}
int f[1010][12][1010];
inline int quickpow(int x, int k) {
  int res = 1;
  while (k) {
    if (k & 1) res = 1ll * res * x % P;
    x = 1ll * x * x % P;
    k >>= 1;
  }
  return res;
}
int jie[1010], jieni[1010];
inline void init() {
  jie[0] = jieni[0] = 1;
  const int up = 100;
  for (int i = 1; i <= up; ++i) jie[i] = 1ll * jie[i - 1] * i % P;
  jieni[up] = quickpow(jie[up], P - 2);
  for (int i = up - 1; i; --i) jieni[i] = 1ll * jieni[i + 1] * (i + 1) % P;
}
inline int get_c(int n, int m) {
  if (m > n) return 0;
  int tmp = 1;
  for (int i = n - m + 1; i <= n; ++i) tmp = 1ll * tmp * i % P;
  tmp = 1ll * tmp * jieni[m] % P;
  return tmp;
}
int main() {
  read(n), read(d), read(P);
  if (n == 2) {
    puts("1");
    return 0;
  }
  if (n == 1) {
    puts("1");
    return 0;
  }
  init();
  f[1][0][0] = 1;
  for (int i = 1; i <= n; ++i) {
    for (int j = 0; j <= d && j < i; ++j) {
      f[i][j][1] = j == (i - 1);
      for (int k = 2; k <= i; ++k) {
        f[i][j][k] = f[i][j][k - 1];
        for (int t = 1; t <= j; ++t)
          if (i - t * k >= 0) {
            f[i][j][k] =
                (f[i][j][k] + 1ll * f[i - t * k][j - t][min(k - 1, i - t * k)] *
                                  get_c(f[k][d - 1][k] + t - 1, t)) %
                P;
          } else
            break;
      }
    }
  }
  int ans = f[n][d][n >> 1];
  if (!(n & 1)) ans = (ans - get_c(f[n >> 1][d - 1][(n >> 1)], 2) + P) % P;
  printf("%d\n", (ans % P + P) % P);
  return 0;
}