#include <bits/stdc++.h>
using namespace std;
const int N = 505;
int f[N][N], g[N][N], C[N][N];
int n, m, mod;
inline int S(int n) { return 1ll * n * (n + 1) / 2 % mod; }
int G(int i, int j) {
  if (g[i][j] != -1) return g[i][j];
  g[i][j] = 0;
  if (i == j) {
    if (!i) return g[i][j] = 1;
    for (int k = 1; k <= i; k++)
      g[i][j] = (g[i][j] + 1ll * (i + 1) * G(k - 1, k - 1) % mod *
                               G(i - k, i - k) % mod * C[i - 1][k - 1] % mod) %
                mod;
    return g[i][j];
  }
  g[i][j] = G(i - 1, j);
  for (int k = 1; k <= j; k++)
    g[i][j] =
        (g[i][j] + 1ll * C[j][k] * G(k, k) % mod * G(i - k - 1, j - k) % mod) %
        mod;
  return g[i][j];
}
int F(int i, int j) {
  if (f[i][j] != -1) return f[i][j];
  f[i][j] = 0;
  if (i == j) {
    for (int k = 1; k <= i; k++) {
      f[i][j] = (f[i][j] + 1ll * (i + 1) * C[i - 1][k - 1] % mod *
                               (1ll * F(k - 1, k - 1) * G(i - k, i - k) % mod +
                                1ll * G(k - 1, k - 1) * F(i - k, i - k) % mod) %
                               mod) %
                mod;
      f[i][j] = (f[i][j] + 1ll * (S(k - 1) + S(i - k)) * C[i - 1][k - 1] % mod *
                               G(k - 1, k - 1) % mod * G(i - k, i - k) % mod) %
                mod;
    }
    return f[i][j];
  }
  f[i][j] = F(i - 1, j);
  for (int k = 1; k <= j; k++)
    f[i][j] = (f[i][j] + 1ll * C[j][k] *
                             (1ll * F(i - k - 1, j - k) * G(k, k) % mod +
                              1ll * G(i - k - 1, j - k) * F(k, k) % mod) %
                             mod) %
              mod;
  return f[i][j];
}
int main() {
  scanf("%d%d%d", &n, &m, &mod);
  memset(f, -1, sizeof(f));
  memset(g, -1, sizeof(g));
  for (int i = 0; i <= n; i++) {
    C[i][0] = 1;
    for (int j = 1; j <= i; j++)
      C[i][j] = (C[i - 1][j] + C[i - 1][j - 1]) % mod;
  }
  printf("%d\n", F(n, m));
  return 0;
}
