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
#include <bits/stdc++.h>
using namespace std;
bool home = 1;
signed realMain();
signed main() {
  home = 0;
  if (home) {
    freopen("tony_stark", "r", stdin);
  } else {
    ios::sync_with_stdio(0);
    cin.tie(0);
  }
  realMain();
}
long long mod;
long long add(long long a, long long b) {
  a += b;
  if (a >= mod) return a - mod;
  if (a < 0) return a + mod;
  return a;
}
long long mul(long long a, long long b) { return a * (long long)b % mod; }
long long pw(long long a, long long b) {
  long long r = 1;
  while (b) {
    if (b & 1) r = mul(r, a);
    a = mul(a, a);
    b /= 2;
  }
  return r;
}
long long dv(long long a, long long b) { return mul(a, pw(b, mod - 2)); }
void baga(long long &a, long long x) { a = add(a, x); }
const long long N = 1234 + 7;
const long long D = 10 + 7;
long long fact[N], ifact[N], dp[N][D][N];
long long comb(long long n, long long k) {
  assert(k < D);
  long long ret = ifact[k];
  for (long long i = n - k + 1; i <= n; i++) ret = mul(ret, i);
  return ret;
}
signed realMain() {
  long long n, wanda;
  cin >> n >> wanda >> mod;
  if (n <= 2) {
    cout << "1\n";
    return 0;
  }
  fact[0] = 1;
  for (long long i = 1; i < N; i++) fact[i] = mul(fact[i - 1], i);
  ifact[N - 1] = dv(1, fact[N - 1]);
  for (long long i = N - 2; i >= 0; i--) ifact[i] = mul(ifact[i + 1], i + 1);
  { dp[1][0][0] = dp[1][wanda - 1][0] = 1; }
  for (long long i = 1; i <= n; i++) {
    for (long long j = 0; j <= wanda; j++) {
      for (long long k = 1; k <= n; k++) {
        baga(dp[i][j][k], dp[i][j][k - 1]);
        for (long long t = 1; t <= j && t * k <= i; t++) {
          baga(dp[i][j][k], mul(dp[i - t * k][j - t][k - 1],
                                comb(dp[k][wanda - 1][k - 1] + t - 1, t)));
        }
      }
    }
  }
  long long ret = dp[n][wanda][(n - 1) / 2];
  if (n % 2 == 0) {
    ret = add(ret, comb(dp[n / 2][wanda - 1][n / 2 - 1] + 1, 2));
  }
  cout << ret << "\n";
  return 0;
}
