#include <bits/stdc++.h>
using namespace std;
long long jc[501], Jc[501], f[501], g[501], h[501][501][2], C[501][501], s, ans,
    F;
int n, m, mod, Mod, i, j, k, l;
long long qpower(long long a, int b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = ans * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return ans;
}
int main() {
  scanf("%d%d%d", &n, &m, &mod), Mod = mod - 2;
  jc[0] = 1;
  for (i = 1; i <= n; i++) jc[i] = jc[i - 1] * i % mod;
  Jc[n] = qpower(jc[n], Mod);
  for (i = n - 1; i >= 0; i--) Jc[i] = Jc[i + 1] * (i + 1) % mod;
  C[0][0] = 1;
  for (i = 1; i <= n; i++) {
    C[i][0] = C[i][i] = 1;
    for (j = 1; j <= i - 1; j++)
      C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]) % mod;
  }
  f[0] = 1;
  g[0] = 0;
  for (i = 1; i <= m; i++) {
    for (j = 1; j <= i; j++) {
      s = (j * (j - 1) / 2 + (i - j + 1) * (i - j) / 2) % mod;
      f[i] = ((f[i]) +
              (f[j - 1] * f[i - j] % mod * (i + 1) % mod * C[i - 1][j - 1])) %
             mod;
      g[i] = ((g[i]) +
              (((g[j - 1] * f[i - j] + f[j - 1] * g[i - j]) % mod * (i + 1) +
                f[j - 1] * f[i - j] % mod * s) %
               mod * C[i - 1][j - 1])) %
             mod;
    }
  }
  h[0][0][0] = 1;
  for (i = 0; i <= (m < n - m + 1 ? m : n - m + 1) - 1; i++) {
    for (j = 0; j <= m - 1; j++) {
      for (k = 1; k <= m - j; k++) {
        F = f[k] * C[j + k][j] % mod;
        h[i + 1][j + k][0] = ((h[i + 1][j + k][0]) + (h[i][j][0] * F)) % mod;
        h[i + 1][j + k][1] = ((h[i + 1][j + k][1]) + (h[i][j][1] * F)) % mod;
        h[i + 1][j + k][1] =
            ((h[i + 1][j + k][1]) + (h[i][j][0] * g[k] % mod * C[j + k][j])) %
            mod;
      }
    }
  }
  for (i = 1; i <= (m < n - m + 1 ? m : n - m + 1); i++)
    ans = ((ans) + (h[i][m][1] * C[n - m + 1][i])) % mod;
  printf("%lld\n", (ans + mod) % mod);
  fclose(stdin);
  fclose(stdout);
  return 0;
}
