#include <bits/stdc++.h>
using namespace std;
const int N = 520;
long long C[N][N], mod;
long long dp1[N], dp2[N], dp3[N][N], dp4[N][N];
int n, m;
int main() {
  scanf("%d%d%lld", &n, &m, &mod);
  C[0][0] = 1;
  for (int i = 1; i <= n; i++) {
    C[i][0] = 1;
    for (int j = 1; j <= i; j++)
      C[i][j] = (C[i - 1][j] + C[i - 1][j - 1]) % mod;
  }
  dp1[0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= i; j++)
      dp1[i] = (dp1[i] + dp1[j - 1] * dp1[i - j] % mod * C[i - 1][j - 1]) % mod;
    dp1[i] = dp1[i] * (i + 1) % mod;
  }
  dp2[0] = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= i; j++)
      dp2[i] = (dp2[i] +
                (dp2[j - 1] * dp1[i - j] + dp2[i - j] * dp1[j - 1]) % mod *
                    C[i - 1][j - 1] % mod * (i + 1) +
                (C[i - j + 1][2] + C[j][2]) * dp1[j - 1] % mod * dp1[i - j] %
                    mod * C[i - 1][j - 1]) %
               mod;
  }
  dp3[0][0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < i; j++) {
      dp3[i][j] = dp3[i - 1][j];
      for (int l = 1; l <= j; l++)
        dp3[i][j] =
            (dp3[i][j] + dp1[l] * dp3[i - l - 1][j - l] % mod * C[j][l]) % mod;
    }
    dp3[i][i] = dp1[i];
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < i; j++) {
      dp4[i][j] = dp4[i - 1][j];
      for (int l = 1; l <= j; l++)
        dp4[i][j] =
            (dp4[i][j] + dp2[l] * dp3[i - l - 1][j - l] % mod * C[j][l] +
             dp1[l] * dp4[i - l - 1][j - l] % mod * C[j][l]) %
            mod;
    }
    dp4[i][i] = dp2[i];
  }
  cout << dp4[n][m];
  return 0;
}
