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 n, d, Md, f2[1010][1010][11], ny[1010], f[1010];
int Quick(int a, int b) {
  int Now = a, ret = 1;
  for (; b; b >>= 1, Now = 1LL * Now * Now % Md)
    if (b & 1) ret = 1LL * ret * Now % Md;
  return ret;
}
int main() {
  cin >> n >> d >> Md;
  if (n <= 2) {
    printf("1");
    return 0;
  }
  for (int i = 1; i <= 1000; i++) ny[i] = Quick(i, Md - 2);
  f[1] = 1;
  f2[0][0][0] = 1;
  for (int(W) = (0); (W) <= (d); (W)++) f2[1][W][W] = 1;
  for (int i = 2; i * 2 <= n; i++) {
    f[i] = f2[i - 1][i - 1][d - 1];
    for (int(k) = (0); (k) <= (d); (k)++)
      for (int(j) = (0); (j) <= (n); (j)++)
        if (f2[i - 1][j][k]) {
          int Now = f2[i - 1][j][k];
          for (int l = 0; j + l * i <= n && l + k <= d && Now; l++) {
            f2[i][j + l * i][l + k] += Now;
            if (f2[i][j + l * i][l + k] >= Md) f2[i][j + l * i][l + k] -= Md;
            Now = 1LL * Now * (f[i] + l) % Md * ny[l + 1] % Md;
          }
        }
  }
  if (n & 1)
    printf("%d\n", f2[n >> 1][n - 1][d]);
  else {
    int ans = f2[(n >> 1) - 1][n - 1][d], Now = f[n >> 1];
    Now = 1LL * (Now + 1) * Now % Md * ny[2] % Md;
    ans = (ans + Now) % Md;
    printf("%d\n", ans);
  }
  return 0;
}