#include <bits/stdc++.h>
using namespace std;
enum { N = 507 };
int n, m, P, C[N][N], F[N][N], G[N][N];
int main() {
  cin >> n >> m >> P;
  for (int i = 0; i <= n; ++i)
    for (int j = *C[i] = 1; j <= i; ++j)
      C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]) % P;
  for (int i = 0; i <= n; ++i) F[i][0] = 1;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= i; ++j) {
      if (i == j) {
        for (int k = 1; k <= i; ++k) {
          F[i][j] = (F[i][j] + 1LL * F[k - 1][k - 1] * F[i - k][i - k] % P *
                                   (i + 1) % P * C[i - 1][k - 1]) %
                    P;
          G[i][j] = (G[i][j] +
                     1LL * F[k - 1][k - 1] * G[i - k][i - k] % P * (i + 1) % P *
                         C[i - 1][k - 1] +
                     1LL * G[k - 1][k - 1] * F[i - k][i - k] % P * (i + 1) % P *
                         C[i - 1][k - 1] +
                     1LL * (C[k][2] + C[i - k + 1][2]) * F[k - 1][k - 1] % P *
                         F[i - k][i - k] % P * C[i - 1][k - 1]) %
                    P;
        }
      } else {
        for (int k = 1; k <= j + 1; ++k) {
          F[i][j] = (F[i][j] + 1LL * F[k - 1][k - 1] * F[i - k][j - k + 1] % P *
                                   C[j][k - 1]) %
                    P;
          G[i][j] =
              (G[i][j] +
               1LL * G[k - 1][k - 1] * F[i - k][j - k + 1] % P * C[j][k - 1] +
               1LL * F[k - 1][k - 1] * G[i - k][j - k + 1] % P * C[j][k - 1]) %
              P;
        }
      }
    }
  }
  cout << G[n][m];
  return 0;
}
