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, class S>
ostream& operator<<(ostream& os, const pair<T, S>& v) {
  return os << "(" << v.first << ", " << v.second << ")";
}
template <class T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  os << "[";
  for (int i = int(0); i <= int((static_cast<int>((v).size())) - 1); ++i) {
    if (i) os << ", ";
    os << v[i];
  }
  return os << "]";
}
template <class T>
bool setmax(T& _a, T _b) {
  if (_b > _a) {
    _a = _b;
    return true;
  }
  return false;
}
template <class T>
bool setmin(T& _a, T _b) {
  if (_b < _a) {
    _a = _b;
    return true;
  }
  return false;
}
template <class T>
T gcd(T _a, T _b) {
  return _b == 0 ? _a : gcd(_b, _a % _b);
}
const int N = 1010;
const int D = 11;
long long f[N][D][N];
long long inv[D];
int main() {
  int n, d;
  long long mod;
  cin >> n >> d >> mod;
  const auto power = [mod](long long a, long long b) {
    long long c = 1;
    for (; b > 0; b >>= 1, a = a * a % mod)
      if (b & 1) c = c * a % mod;
    return c;
  };
  for (int i = int(1); i <= int(D - 1); ++i) inv[i] = power(i, mod - 2);
  memset(f, 0, sizeof(f));
  for (int j = int(0); j <= int(d); ++j)
    for (int k = int(0); k <= int(n); ++k) f[1][j][k] = 1;
  for (int i = int(2); i <= int(n); ++i)
    for (int j = int(0); j <= int(d); ++j)
      for (int k = int(1); k <= int(n); ++k) {
        long long cur = 1, p = f[k][d - 1][k - 1];
        long long ans = 0;
        for (int t = int(0); t <= int(min(j, (i - 1) / k)); ++t) {
          if (i - t * k != 1 || (i - t * k == 1 && j == t)) {
            ans += f[i - t * k][j - t][k - 1] * cur;
          }
          (cur *= p + t) %= mod;
          (cur *= inv[t + 1]) %= mod;
        }
        f[i][j][k] = ans % mod;
      }
  long long ans = f[n][d][(n - 1) / 2];
  if (n % 2 == 0) {
    long long tmp = f[n / 2][d - 1][n / 2 - 1];
    (ans += tmp * (tmp + 1) / 2) %= mod;
  }
  cout << ans << endl;
  return 0;
}