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>
using namespace std;
template <class T>
bool cmax(T &x, T y) {
  return y > x ? x = y, 1 : 0;
}
template <class T>
bool cmin(T &x, T y) {
  return y < x ? x = y, 1 : 0;
}
const int N = 1005, M = 15;
int n, m, mod, f[N][M][N], ifac[M], fac[M];
int kpow(int a, int k) {
  int res = 1;
  for (; k; k >>= 1, a = 1ll * a * a % mod)
    if (k & 1) res = 1ll * res * a % mod;
  return res;
}
int C(int n, int m) {
  int res = 1;
  for (int i = 0; i < m; ++i) res = 1ll * res * (n - i) % mod;
  return 1ll * res * ifac[m] % mod;
}
int F(int n, int d, int mx) {
  if (!d || !mx || n == 1) return n == 1 && !d;
  if (~f[n][d][mx]) return f[n][d][mx];
  f[n][d][mx] = F(n, d, mx - 1);
  for (int i = 1; i <= min(n - 1, d) && i * mx < n; ++i)
    (f[n][d][mx] += 1ll * F(n - i * mx, d - i, mx - 1) *
                    C((mx == 1 ? 1 : F(mx, m - 1, mx)) + i - 1, i) % mod) %=
        mod;
  return f[n][d][mx];
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m >> mod;
  if (n <= 2) {
    cout << 1 << endl;
    return 0;
  }
  fac[0] = 1;
  for (int i = 1; i <= m; ++i) fac[i] = 1ll * i * fac[i - 1] % mod;
  ifac[m] = kpow(fac[m], mod - 2);
  for (int i = m - 1; i >= 0; --i) ifac[i] = 1ll * ifac[i + 1] * (i + 1) % mod;
  memset(f, -1, sizeof f);
  if (n & 1)
    cout << F(n, m, n / 2) << endl;
  else {
    cout << (F(n, m, n / 2) + mod - C(F(n / 2, m - 1, n / 2 - 1), 2)) % mod
         << endl;
  }
  return 0;
}