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;
int d, mod, f;
int bigmod(int v, int p) {
  if (p == 0) return 1;
  if (p == 1) return v;
  if (p & 1) {
    return 1LL * v * bigmod(v, p - 1) % mod;
  }
  int ret = bigmod(v, p / 2);
  return 1LL * ret * ret % mod;
}
int dp[1001], dp2[1001][600][11];
long long inv[13];
int dp_func(int n);
int dp_func2(int n, int kto, int d) {
  if (n == 0) return d == 0;
  if (d == 0 || kto == 0) return 0;
  if (dp2[n][kto][d] != -1) return dp2[n][kto][d];
  long long ret = 0;
  int g = dp_func(kto);
  g--;
  long long tmp = 1;
  for (int i = 1; i <= d; i++) {
    if (n < (i * kto)) break;
    g++;
    tmp = (tmp * g) % mod;
    tmp = (tmp * inv[i]) % mod;
    ret += 1LL * dp_func2(n - i * kto, kto - 1, d - i) * tmp % mod;
  }
  ret += dp_func2(n, kto - 1, d);
  return dp2[n][kto][d] = ret % mod;
}
int dp_func(int n) {
  if (n == 1) return 1;
  if (dp[n] != -1) return dp[n];
  int ret;
  ret = dp_func2(n - 1, n - 1, d - 1);
  return dp[n] = ret;
}
int main() {
  int i, j, k, l, m;
  int n;
  scanf("%d%d%d", &n, &d, &mod);
  if (n == 1 || n == 2) {
    cout << 1 << endl;
    return 0;
  }
  for (int i = 1; i <= 11; i++) {
    inv[i] = bigmod(i, mod - 2);
  }
  memset(dp, -1, sizeof dp);
  memset(dp2, -1, sizeof dp2);
  int ans = dp_func2(n - 1, n / 2, d);
  if (n % 2 == 0) {
    long long dd = dp_func(n / 2);
    dd = dd * (dd - 1);
    dd /= 2;
    dd %= mod;
    ans -= dd;
    if (ans < 0) ans += mod;
  }
  cout << ans << endl;
}