#include <bits/stdc++.h>
using namespace std;
inline void read(int &x) {
  int v = 0, f = 1;
  char c = getchar();
  while (!isdigit(c) && c != '-') c = getchar();
  if (c == '-')
    f = -1;
  else
    v = (c & 15);
  while (isdigit(c = getchar())) v = (v << 1) + (v << 3) + (c & 15);
  x = v * f;
}
inline void read(long long &x) {
  long long v = 0ll, f = 1ll;
  char c = getchar();
  while (!isdigit(c) && c != '-') c = getchar();
  if (c == '-')
    f = -1;
  else
    v = (c & 15);
  while (isdigit(c = getchar())) v = (v << 1) + (v << 3) + (c & 15);
  x = v * f;
}
inline void readc(char &x) {
  char c;
  while (((c = getchar()) == ' ') || c == '\n')
    ;
  x = c;
}
int mod, n, m, i, j, k, c[505][505], f[505], g[505], dp[505][505][2], ans;
int main() {
  read(n);
  read(m);
  read(mod);
  c[0][0] = 1;
  for (((i)) = (1); ((i)) <= ((n)); ((i))++) {
    c[i][0] = 1;
    for (((j)) = (1); ((j)) <= ((i)); ((j))++)
      c[i][j] = (c[i - 1][j] + c[i - 1][j - 1]) % mod;
  }
  f[0] = 1;
  for (((i)) = (1); ((i)) <= ((n)); ((i))++) {
    for (((j)) = (0); ((j)) <= (((int)(i)) - 1); ((j))++) {
      k = i - j - 1;
      f[i] =
          (f[i] + 1ll * f[j] * f[k] % mod * (i + 1) % mod * c[i - 1][j]) % mod;
      g[i] =
          (g[i] + 1ll * g[j] * f[k] % mod * (i + 1) % mod * c[i - 1][j]) % mod;
      g[i] =
          (g[i] + 1ll * f[j] * g[k] % mod * (i + 1) % mod * c[i - 1][j]) % mod;
      g[i] = (g[i] + 1ll * f[j] * f[k] % mod * c[i - 1][j] % mod *
                         ((j * (j + 1) / 2) + (k * (k + 1) / 2))) %
             mod;
    }
  }
  dp[0][0][1] = 1;
  for (((i)) = (0); ((i)) <= (((int)(n)) - 1); ((i))++) {
    for (((j)) = (0); ((j)) <= (((int)(i + 1)) - 1); ((j))++) {
      dp[i + 1][j][1] =
          (0ll + dp[i + 1][j][1] + dp[i][j][0] + dp[i][j][1]) % mod;
      for (((k)) = (1); ((k)) <= ((n - i)); ((k))++) {
        dp[i + k][j + k][0] = (dp[i + k][j + k][0] +
                               1ll * dp[i][j][1] * f[k] % mod * c[j + k][j]) %
                              mod;
      }
    }
  }
  for (((j)) = (1); ((j)) <= ((n)); ((j))++)
    for (((i)) = (1); ((i)) <= ((j)); ((i))++) {
      int rem = m - (j - i + 1);
      if (rem < 0) continue;
      for (((k)) = (0); ((k)) <= (((int)(rem + 1)) - 1); ((k))++) {
        ans = (ans + 1ll * g[j - i + 1] * dp[i - 1][k][1] % mod *
                         dp[n - j][rem - k][1] % mod * c[m][rem] % mod *
                         c[rem][k]) %
              mod;
      }
    }
  cout << ans << endl;
  return 0;
}
