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 IN() {
  int x = 0, f = 0, ch;
  for (; (ch = getchar()) < '0' || ch > '9';) f = (ch == '-');
  for (; ch >= '0' && ch <= '9'; (ch = getchar())) x = x * 10 + ch - '0';
  return f ? -x : x;
}
int N, M, P, A[1005], B[1005][15], C[15];
int Pow(int a, int b) {
  int ret = 1;
  for (; b; b >>= 1, a = 1ll * a * a % P)
    if (b & 1) ret = 1ll * ret * a % P;
  return ret;
}
int main(int argc, char* argv[]) {
  N = IN();
  M = IN();
  P = IN();
  if (N <= 2) return puts("1"), 0;
  B[0][0] = 1;
  for (int i = 1, lim = N / 2; i <= lim; i++) {
    if (i == 1)
      A[i] = 1;
    else
      A[i] = B[i - 1][M - 1];
    C[0] = 1;
    for (int j = 1, lim = M; j <= lim; j++)
      C[j] = 1ll * C[j - 1] * (A[i] + j - 1) % P * Pow(j, P - 2) % P;
    for (int j = N, lim = 0; j >= lim; j--)
      for (int k = M, lim = 0; k >= lim; k--)
        if (B[j][k])
          for (int t = 1, lim = M - k; t <= lim; t++) {
            int x = j + t * i;
            if (x <= N) B[x][k + t] = (B[x][k + t] + 1ll * B[j][k] * C[t]) % P;
          }
  }
  int Ans = B[N - 1][M];
  if (N % 2 == 0) {
    int t = B[N / 2 - 1][M - 1];
    Ans = (Ans - 1ll * t * (t - 1) / 2) % P;
  }
  cout << (Ans + P) % P << endl;
  return 0;
}