#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
ll MOD;
const ll root = 3;
ll binpow(ll a, ll b) {
  ll res = 1;
  while (b) {
    if (b & 1) res = (res * a) % MOD;
    a = (a * a) % MOD;
    b >>= 1;
  }
  return res;
}
ll modInv(ll a) { return binpow(a, MOD - 2); }
const int INF = 0x3f3f3f3f;
const int NINF = 0xc0c0c0c0;
const ll INFLL = 0x3f3f3f3f3f3f3f3f;
const ll NINFLL = 0xc0c0c0c0c0c0c0c0;
const int mxN = 501;
ll dp1[mxN][mxN], dp2[mxN][mxN];
ll nCr[mxN][mxN];
int n, m;
int main() {
  mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
  cin.tie(0)->sync_with_stdio(0);
  cin >> n >> m >> MOD;
  nCr[0][0] = 1;
  for (int i = (1); i < (mxN); ++i) {
    nCr[i][0] = 1;
    for (int j = (1); j < (i + 1); ++j) {
      nCr[i][j] = (nCr[i - 1][j - 1] + nCr[i - 1][j]) % MOD;
    }
  }
  dp1[0][0] = 1;
  for (int i = (1); i < (n + 1); ++i) {
    for (int j = (0); j < (i); ++j) {
      dp1[i][i] = (dp1[i][i] + dp1[j][j] * dp1[i - j - 1][i - j - 1] % MOD *
                                   nCr[i - 1][j]) %
                  MOD;
    }
    dp1[i][i] *= (i + 1);
    dp1[i][i] %= MOD;
  }
  dp2[0][0] = 0;
  for (int i = (1); i < (n + 1); ++i) {
    for (int j = (0); j < (i); ++j) {
      dp2[i][i] =
          (dp2[i][i] + (j * (j + 1) / 2 + (i - j - 1) * (i - j) / 2) % MOD *
                           dp1[j][j] % MOD * dp1[i - j - 1][i - j - 1] % MOD *
                           nCr[i - 1][j]) %
          MOD;
      dp2[i][i] = (dp2[i][i] + (i + 1) * nCr[i - 1][j] % MOD *
                                   ((dp2[j][j] * dp1[i - j - 1][i - j - 1] +
                                     dp2[i - j - 1][i - j - 1] * dp1[j][j]) %
                                    MOD)) %
                  MOD;
    }
  }
  for (int i = (1); i < (n + 1); ++i) {
    for (int j = (0); j < (i); ++j) {
      dp1[i][j] = dp1[i - 1][j];
      for (int k = (1); k < (j + 1); ++k) {
        dp1[i][j] =
            (dp1[i][j] + dp1[k][k] * dp1[i - k - 1][j - k] % MOD * nCr[j][k]) %
            MOD;
      }
    }
  }
  for (int i = (1); i < (n + 1); ++i) {
    for (int j = (0); j < (i); ++j) {
      dp2[i][j] = dp2[i - 1][j];
      for (int k = (1); k < (j + 1); ++k) {
        dp2[i][j] = (dp2[i][j] + (dp2[i - k - 1][j - k] * dp1[k][k] +
                                  dp2[k][k] * dp1[i - k - 1][j - k]) %
                                     MOD * nCr[j][k]) %
                    MOD;
      }
    }
  }
  cout << dp2[n][m] << "\n";
  return 0;
}
