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>
#pragma GCC optimize("O2,Ofast,inline,unroll-all-loops,-ffast-math")
#pragma GCC target("avx,sse2,sse3,sse4,popcnt")
using namespace std;
int n, d;
long long f[1010][15][1010], g[1010][15], ifac[15], mod;
template <class T>
void read(T &x) {
  char ch = x = 0;
  bool fl = false;
  while (!isdigit(ch)) fl |= ch == '-', ch = getchar();
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  x = fl ? -x : x;
}
long long pw(long long a, long long b) {
  long long ret = 1;
  while (b) {
    if (b & 1) ret = ret * a % mod;
    a = a * a % mod, b >>= 1;
  }
  return ret;
}
long long C(long long a, int b) {
  long long ret = ifac[b];
  for (int i = 1; i <= b; i++) ret = ret * (a - i + 1) % mod;
  return ret;
}
int main() {
  read(n), read(d), read(mod);
  if (n <= 2) return puts("1"), 0;
  ifac[0] = 1;
  for (int i = 1; i <= d; i++) ifac[i] = ifac[i - 1] * pw(i, mod - 2) % mod;
  for (int i = 0; i <= n; i++) f[1][0][i] = 1;
  for (int i = 1; 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 <= n; k++) {
        f[i][j][k] = f[i][j][k - 1];
        for (int l = 1; l <= min(j, i / k); l++)
          f[i][j][k] =
              (f[i][j][k] + f[i - l * k][j - l][k - 1] * g[k][l]) % mod;
      }
    }
    for (int j = 1; j <= d; j++) g[i][j] = C(f[i][d - 1][n] + j - 1, j);
  }
  long long ans = f[n][d][n / 2];
  if (~n & 1)
    ans =
        (ans - f[n / 2][d - 1][n / 2] * (f[n / 2][d - 1][n / 2] - 1) / 2 % mod +
         mod) %
        mod;
  printf("%lld\n", ans);
  return 0;
}