#include <bits/stdc++.h>
using namespace std;
int n, m, mod, i, j, k;
long long f[505], g[505], C[505][505], ans, f0[505][505], g0[505][505];
long long P(int n, int m) { return C[n + m - 1][m - 1]; }
int main() {
  scanf("%d%d%d", &n, &m, &mod);
  C[0][0] = 1;
  for (int i = 1; i <= n + 1; 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;
  }
  f[0] = 1, g[0] = 0, f[1] = 2, g[1] = 0;
  for (int i = 2; i <= n; i++) {
    (f[i] += f[i - 1] * (i + 1) * 2) %= mod;
    (g[i] += f[i - 1] * i % mod * (i - 1)) %= mod;
    (g[i] += g[i - 1] * (i + 1) * 2) %= mod;
    for (int j = 1; j + 1 < i; j++) {
      k = i - j - 1;
      (f[i] += f[j] * f[k] % mod * (j + k + 2) % mod * C[j + k][k]) %= mod;
      (g[i] += (g[j] * f[k] + g[k] * f[j]) % mod * (j + k + 2) % mod *
               C[j + k][k]) %= mod;
      (g[i] += f[j] * f[k] % mod * C[j + k][k] % mod *
               ((1ll * (j + 1) * j / 2 + 1ll * (k + 1) * k / 2) % mod)) %= mod;
    }
  }
  f0[0][0] = 1, g0[0][0] = 0;
  for (int i = 0; i <= m; i++)
    for (int j = 0; j <= m; j++)
      if (f0[i][j]) {
        for (int k = 1; j + k <= m; k++) {
          (f0[i + 1][j + k] += f0[i][j] * f[k] % mod * C[j + k][k]) %= mod;
          (g0[i + 1][j + k] +=
           (g0[i][j] * f[k] + f0[i][j] * g[k]) % mod * C[j + k][k]) %= mod;
        }
      }
  for (int i = 1; i <= m; i++)
    if (n + 1 - m - i >= 0) (ans += g0[i][m] * P(n + 1 - m - i, i + 1)) %= mod;
  printf("%lld\n", ans);
}
