#include <bits/stdc++.h>
using namespace std;
inline int read() {
  char c = getchar();
  int x = 0;
  bool f = 0;
  for (; !isdigit(c); c = getchar()) f ^= !(c ^ 45);
  for (; isdigit(c); c = getchar()) x = (x << 1) + (x << 3) + (c ^ 48);
  if (f) x = -x;
  return x;
}
int mod;
struct modint {
  int x;
  modint(int o = 0) { x = o; }
  modint &operator=(int o) { return x = o, *this; }
  modint &operator+=(modint o) {
    return x = x + o.x >= mod ? x + o.x - mod : x + o.x, *this;
  }
  modint &operator-=(modint o) {
    return x = x - o.x < 0 ? x - o.x + mod : x - o.x, *this;
  }
  modint &operator*=(modint o) { return x = 1ll * x * o.x % mod, *this; }
  modint &operator^=(int b) {
    modint a = *this, c = 1;
    for (; b; b >>= 1, a *= a)
      if (b & 1) c *= a;
    return x = c.x, *this;
  }
  modint &operator/=(modint o) { return *this *= o ^= mod - 2; }
  modint &operator+=(int o) {
    return x = x + o >= mod ? x + o - mod : x + o, *this;
  }
  modint &operator-=(int o) {
    return x = x - o < 0 ? x - o + mod : x - o, *this;
  }
  modint &operator*=(int o) { return x = 1ll * x * o % mod, *this; }
  modint &operator/=(int o) { return *this *= ((modint(o)) ^= mod - 2); }
  template <class I>
  friend modint operator+(modint a, I b) {
    return a += b;
  }
  template <class I>
  friend modint operator-(modint a, I b) {
    return a -= b;
  }
  template <class I>
  friend modint operator*(modint a, I b) {
    return a *= b;
  }
  template <class I>
  friend modint operator/(modint a, I b) {
    return a /= b;
  }
  friend modint operator^(modint a, int b) { return a ^= b; }
  friend bool operator==(modint a, int b) { return a.x == b; }
  friend bool operator!=(modint a, int b) { return a.x != b; }
  bool operator!() { return !x; }
  modint operator-() { return x ? mod - x : 0; }
};
int n, m;
modint fac[505], ifac[505];
modint f[505][505], g[505][505];
bool vf[505][505], vg[505][505];
inline void prework(int n) {
  fac[0] = 1;
  for (register int i = (1); i <= (n); ++i) fac[i] = fac[i - 1] * i;
  ifac[n] = 1 / fac[n];
  for (register int i = (n - 1); i >= (0); --i) ifac[i] = ifac[i + 1] * (i + 1);
}
inline modint C(int n, int m) { return fac[n] * ifac[m] * ifac[n - m]; }
modint F(int i, int j);
modint G(int i, int j);
inline modint sum(int x) { return 1ll * x * (x + 1) / 2 % mod; }
modint F(int i, int j) {
  if (vf[i][j]) return f[i][j];
  vf[i][j] = 1, f[i][j] = 0;
  if (i == j) {
    for (register int k = (1); k <= (i); ++k)
      f[i][i] += C(i - 1, k - 1) * (i + 1) *
                 (G(k - 1, k - 1) * F(i - k, i - k) +
                  G(i - k, i - k) * F(k - 1, k - 1)),
          f[i][i] += C(i - 1, k - 1) * G(k - 1, k - 1) * G(i - k, i - k) *
                     (sum(k - 1) + sum(i - k));
    return f[i][i];
  }
  f[i][j] = F(i - 1, j);
  for (register int k = (1); k <= (j); ++k)
    f[i][j] += C(j, k) *
               (F(i - k - 1, j - k) * G(k, k) + F(k, k) * G(i - k - 1, j - k));
  return f[i][j];
}
modint G(int i, int j) {
  if (vg[i][j]) return g[i][j];
  vg[i][j] = 1, g[i][j] = 0;
  if (i == j) {
    if (!i) return g[i][i] = 1;
    for (register int k = (1); k <= (i); ++k)
      g[i][i] += G(k - 1, k - 1) * G(i - k, i - k) * C(i - 1, k - 1);
    g[i][i] *= (i + 1);
    return g[i][i];
  }
  g[i][j] = G(i - 1, j);
  for (register int k = (1); k <= (j); ++k)
    g[i][j] += G(i - k - 1, j - k) * G(k, k) * C(j, k);
  return g[i][j];
}
signed main() {
  n = read(), m = read(), mod = read(), prework(501);
  cout << F(n, m).x << endl;
  return 0;
}
