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;
long long f[1005][12][1005], bo[1005][12][1005], fac[100], inv[100], mod;
int n, m;
long long kp(long long a, long long b) {
  if (!b) return 1;
  long long c = kp(a, b / 2);
  c = (c * c) % mod;
  if (b & 1) c = (c * a) % mod;
  return c;
}
long long c(long long x, long long y) {
  if (x < y) return 0;
  long long ans = 1;
  for (long long i = 0; i < y; i++) ans = (ans * (x - i)) % mod;
  ans = (ans * inv[y]) % mod;
  return ans;
}
long long find(int x, int y, int z) {
  if (bo[x][y][z]) return f[x][y][z];
  if (z <= 0) return 0;
  bo[x][y][z] = 1;
  f[x][y][z] = find(x, y, z - 1);
  for (int i = 1; i <= min(x / z, y); i++)
    if (z != 1)
      f[x][y][z] = (f[x][y][z] + find(x - i * z, y - i, z - 1) *
                                     c(find(z, m - 1, z - 1) + i - 1, i)) %
                   mod;
    else
      f[x][y][z] = (f[x][y][z] + find(x - i * z, y - i, z - 1)) % mod;
  return f[x][y][z];
}
int main() {
  scanf("%d%d%lld", &n, &m, &mod);
  for (int i = 0; i <= n; i++) bo[1][0][i] = f[1][0][i] = 1;
  fac[0] = inv[0] = 1;
  for (long long i = 1; i <= 15; i++) fac[i] = (fac[i - 1] * i) % mod;
  inv[15] = kp(fac[15], mod - 2);
  for (long long i = 14; i; i--) inv[i] = (inv[i + 1] * (i + 1)) % mod;
  if (n <= 2)
    puts("1");
  else {
    if (n & 1)
      printf("%lld", find(n, m, n >> 1));
    else
      printf("%lld", (find(n, m, n >> 1) -
                      c(find(n >> 1, m - 1, (n >> 1) - 1), 2) + mod) %
                         mod);
  }
}