#include <bits/stdc++.h>
using namespace std;
const int maxn = 500 + 5;
int n, m, mod;
int upd(const int &x) {
  if (x < 0) return x + mod;
  if (x >= mod) return x - mod;
  return x;
}
void add(int &x, const int &y) { x = upd(x + y); }
int ksm(int x, int k) {
  int ans = 1;
  while (k) {
    if (k & 1) ans = 1ll * ans * x % mod;
    x = 1ll * x * x % mod;
    k >>= 1;
  }
  return ans;
}
int jc[maxn << 2], inv[maxn << 2];
void init(int n) {
  jc[0] = 1;
  for (int i(1), endi(n); i <= endi; i++) jc[i] = 1ll * jc[i - 1] * i % mod;
  inv[n] = ksm(jc[n], mod - 2);
  for (int i(n - 1), endi(0); i >= endi; i--)
    inv[i] = 1ll * inv[i + 1] * (i + 1) % mod;
}
int C(int n, int m) {
  if (n < 0 || m < 0 || n < m) return 0;
  return 1ll * jc[n] * inv[n - m] % mod * inv[m] % mod;
}
vector<int> f, g;
int S(int n) { return n * (n + 1) / 2; }
vector<int> operator*(const vector<int> &A, const vector<int> &B) {
  vector<int> C(A.size() + B.size() - 1);
  for (int i(0), endi(A.size() - 1); i <= endi; i++)
    for (int j(0), endj(B.size() - 1); j <= endj; j++)
      add(C[i + j], 1ll * A[i] * B[j] % mod);
  return C;
}
int G(int n, int m) { return C(m + n - 1, n - 1); }
int main() {
  cin >> m >> n >> mod;
  init(m << 1);
  f.resize(n + 1);
  g.resize(n + 1);
  f[0] = 1;
  for (int i(1), endi(n); i <= endi; i++) {
    for (int j(0), endj(i - 1); j <= endj; j++)
      add(f[i], 1ll * f[j] * f[i - 1 - j] % mod * C(i - 1, j) % mod);
    f[i] = 1ll * f[i] * (i + 1) % mod;
  }
  for (int i(1), endi(n); i <= endi; i++) {
    for (int j(0), endj(i - 1); j <= endj; j++)
      add(g[i],
          (2ll * f[j] * g[i - 1 - j] % mod * C(i - 1, j) % mod * (i + 1) % mod +
           1ll * C(i - 1, j) * (S(j) + S(i - 1 - j)) % mod * f[j] % mod *
               f[i - 1 - j] % mod) %
              mod);
  }
  for (int i(0), endi(n); i <= endi; i++) g[i] = 1ll * g[i] * inv[i] % mod;
  for (int i(0), endi(n); i <= endi; i++) f[i] = 1ll * f[i] * inv[i] % mod;
  int ans = 0;
  vector<int> s;
  s.resize(n + 1);
  s[0] = 1;
  for (int i(1), endi(m - n); i <= endi; i++) {
    s = s * f;
    s.resize(n + 1);
  }
  for (int i(0), endi(n); i <= endi; i++) add(ans, 1ll * s[i] * g[n - i] % mod);
  cout << 1ll * ans * jc[n] % mod * (m - n + 1) % mod;
  return 0;
}
