#include <bits/stdc++.h>
using namespace std;
std::mt19937 rnd(
    (int)std::chrono::steady_clock::now().time_since_epoch().count());
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
const int MAXCOMP = 500;
const int MAXPERS = MAXCOMP;
struct Res {
  int ways, summaddness;
  Res() {}
  Res(int ways, int summaddness) : ways(ways), summaddness(summaddness) {}
};
int ncomp, npers, MOD;
int choose[MAXCOMP + 1][MAXCOMP + 1];
int calcsum(int l, int r) { return (l + r) * (r - l + 1) / 2; }
bool done2[MAXCOMP + 1];
Res mem2[MAXCOMP + 1];
Res go2(int n) {
  if (n == 1) return Res(2, 0);
  if (done2[n]) return mem2[n];
  Res ret(0, 0);
  for (int i = (0); i < (n); ++i) {
    int lcnt = i, rcnt = n - i - 1;
    Res lres = lcnt == 0 ? Res(1, 0) : go2(lcnt);
    Res rres = rcnt == 0 ? Res(1, 0) : go2(rcnt);
    int mways = (lcnt + 1) + (rcnt + 1);
    int msummaddness = calcsum(0, lcnt) + calcsum(0, rcnt);
    int mlt = choose[lcnt + rcnt][lcnt];
    ret.ways = (ret.ways +
                (long long)lres.ways * mways % MOD * rres.ways % MOD * mlt) %
               MOD;
    ret.summaddness =
        (ret.summaddness +
         (long long)lres.summaddness * mways % MOD * rres.ways % MOD * mlt +
         (long long)lres.ways * msummaddness % MOD * rres.ways % MOD * mlt +
         (long long)lres.ways * mways % MOD * rres.summaddness % MOD * mlt) %
        MOD;
  }
  done2[n] = true, mem2[n] = ret;
  return ret;
}
bool done1[MAXCOMP][MAXPERS + 1];
Res mem1[MAXCOMP][MAXPERS + 1];
Res go1(int at, int cnt) {
  if (ncomp - at == cnt) return go2(cnt);
  if (done1[at][cnt]) return mem1[at][cnt];
  Res ret(0, 0);
  for (int i = (at); i < (ncomp); ++i) {
    int lcnt = i - at;
    int rcnt = cnt - lcnt;
    if (rcnt < 0 || rcnt > ncomp - i - 1) continue;
    Res lres = i == at ? Res(1, 0) : go2(lcnt);
    Res rres = i + 1 == ncomp ? Res(1, 0) : go1(i + 1, rcnt);
    int mlt = choose[lcnt + rcnt][lcnt];
    ret.ways = (ret.ways + (long long)lres.ways * rres.ways % MOD * mlt) % MOD;
    ret.summaddness =
        (ret.summaddness + (long long)lres.summaddness * rres.ways % MOD * mlt +
         (long long)lres.ways * rres.summaddness % MOD * mlt) %
        MOD;
  }
  done1[at][cnt] = true, mem1[at][cnt] = ret;
  return ret;
}
int solve() {
  for (int i = (0); i <= (ncomp); ++i) {
    choose[i][0] = choose[i][i] = 1;
    for (int j = (1); j < (i); ++j)
      choose[i][j] = (choose[i - 1][j - 1] + choose[i - 1][j]) % MOD;
  }
  for (int i = (0); i <= (ncomp); ++i) done2[i] = false;
  for (int i = (0); i < (ncomp); ++i)
    for (int j = (0); j <= (npers); ++j) done1[i][j] = false;
  return go1(0, npers).summaddness;
}
void run() {
  scanf("%d%d%d", &ncomp, &npers, &MOD);
  printf("%d\n", solve());
}
int main() {
  run();
  return 0;
}
