#include <bits/stdc++.h>
using namespace std;
int rd() {
  int res = 0, c, f = 0;
  while (!isdigit(c = getchar())) f = c == '-';
  do res = (res << 1) + (res << 3) + (c ^ 48);
  while (isdigit(c = getchar()));
  return f ? -res : res;
}
int n, m, Mod, dp1[505], dp2[505], dp3[505][505], dp4[505][505], C[505][505];
int main() {
  n = rd(), m = rd(), Mod = rd();
  for (int i = 0; i <= n; i++)
    for (int j = 0; j <= i; j++)
      C[i][j] = !j ? 1 : (C[i - 1][j - 1] + C[i - 1][j]),
      C[i][j] >= Mod && (C[i][j] -= Mod);
  dp1[0] = 1;
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j <= i; j++) {
      dp1[i] =
          (dp1[i] + 1ll * dp1[j - 1] * dp1[i - j] % Mod * C[i - 1][j - 1]) %
          Mod;
      dp2[i] =
          (dp2[i] +
           (1ll * dp1[j - 1] * dp1[i - j] % Mod * (C[j][2] + C[i - j + 1][2]) +
            (1ll * dp1[j - 1] * dp2[i - j] + 1ll * dp1[i - j] * dp2[j - 1]) %
                Mod * (i + 1)) %
               Mod * C[i - 1][j - 1]) %
          Mod;
    }
    dp1[i] = 1ll * dp1[i] * (i + 1) % Mod;
  }
  dp3[0][0] = 1;
  for (int i = 1; i <= n; i++)
    for (int j = 0; j <= min(i, m); j++) {
      dp3[i][j] = dp3[i - 1][j], dp4[i][j] = dp4[i - 1][j];
      for (int l = 1; l <= j; l++) {
        dp3[i][j] = (dp3[i][j] + 1ll * dp3[max(0, i - l - 1)][j - l] * dp1[l] %
                                     Mod * C[j][l]) %
                    Mod;
        dp4[i][j] =
            (dp4[i][j] + (1ll * dp3[max(0, i - l - 1)][j - l] * dp2[l] +
                          1ll * dp4[max(0, i - l - 1)][j - l] * dp1[l]) %
                             Mod * C[j][l]) %
            Mod;
      }
    }
  printf("%d\n", dp4[n][m]);
  return 0;
}
