#include <bits/stdc++.h>
using namespace std;
const int N = 105;
int n, m, s, P;
int f[N][N][N], C[N][N], fac[N], mx[N][N];
void add(int &x, int y) {
  x += y;
  if (x >= P) x -= P;
}
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  cin >> n >> m >> s >> P;
  for (int i = 0; i < N; i++) {
    C[i][0] = C[i][i] = 1;
    for (int j = 1; j < i; j++) C[i][j] = (C[i - 1][j] + C[i - 1][j - 1]) % P;
  }
  fac[0] = 1;
  for (int i = 1; i < N; i++) fac[i] = 1ll * fac[i - 1] * i % P;
  for (int i = 0; i <= n; i++) {
    for (int k = i + 1; k <= n; k++) f[i][0][k] = fac[i];
    f[i][0][0] = fac[i];
    for (int j = 0; j <= i; j++) {
      for (int k = 1; k <= i; k++) {
        for (int a = 1; a <= i; a++) {
          int o = j - (k == 1);
          for (int x = max(0, o - mx[i - a][k - 1]);
               x <= min(o, mx[a - 1][k - 1]); x++) {
            add(f[i][j][k], 1ll * f[a - 1][x][k - 1] * f[i - a][o - x][k - 1] %
                                P * C[i - 1][a - 1] % P);
          }
        }
        if (f[i][j][k]) mx[i][k] = j;
      }
    }
  }
  cout << f[n][s][m] << endl;
  return 0;
}

### Prompt

Your task is to create a cpp solution to the following problem:

Let c_1, c_2, …, c_n be a permutation of integers 1, 2, …, n. Consider all subsegments of this permutation containing an integer x. Given an integer m, we call the integer x good if there are exactly m different values of maximum on these subsegments.

Cirno is studying mathematics, and the teacher asks her to count the number of permutations of length n with exactly k good numbers.

Unfortunately, Cirno isn't good at mathematics, and she can't answer this question. Therefore, she asks you for help.

Since the answer may be very big, you only need to tell her the number of permutations modulo p.

A permutation is an array consisting of n distinct integers from 1 to n in arbitrary order. For example, [2,3,1,5,4] is a permutation, but [1,2,2] is not a permutation (2 appears twice in the array) and [1,3,4] is also not a permutation (n=3 but there is 4 in the array).

A sequence a is a subsegment of a sequence b if a can be obtained from b by deletion of several (possibly, zero or all) elements from the beginning and several (possibly, zero or all) elements from the end.

Input

The first line contains four integers n, m, k, p (1 ≤ n ≤ 100, 1 ≤ m ≤ n, 1 ≤ k ≤ n, 1 ≤ p ≤ 10^9).

Output

Output the number of permutations modulo p.

Examples

Input


4 3 2 10007


Output


4


Input


6 4 1 769626776


Output


472


Input


66 11 9 786747482


Output


206331312


Input


99 30 18 650457567


Output


77365367

Note

In the first test case, there are four permutations: [1, 3, 2, 4], [2, 3, 1, 4], [4, 1, 3, 2] and [4, 2, 3, 1].

Take permutation [1, 3, 2, 4] as an example:

For number 1, all subsegments containing it are: [1], [1, 3], [1, 3, 2] and [1, 3, 2, 4], and there're three different maxima 1, 3 and 4.

Similarly, for number 3, there're two different maxima 3 and 4. For number 2, there're three different maxima 2, 3 and 4. And for number 4, there're only one, that is 4 itself.

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
const int N = 105;
int n, m, s, P;
int f[N][N][N], C[N][N], fac[N], mx[N][N];
void add(int &x, int y) {
  x += y;
  if (x >= P) x -= P;
}
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  cin >> n >> m >> s >> P;
  for (int i = 0; i < N; i++) {
    C[i][0] = C[i][i] = 1;
    for (int j = 1; j < i; j++) C[i][j] = (C[i - 1][j] + C[i - 1][j - 1]) % P;
  }
  fac[0] = 1;
  for (int i = 1; i < N; i++) fac[i] = 1ll * fac[i - 1] * i % P;
  for (int i = 0; i <= n; i++) {
    for (int k = i + 1; k <= n; k++) f[i][0][k] = fac[i];
    f[i][0][0] = fac[i];
    for (int j = 0; j <= i; j++) {
      for (int k = 1; k <= i; k++) {
        for (int a = 1; a <= i; a++) {
          int o = j - (k == 1);
          for (int x = max(0, o - mx[i - a][k - 1]);
               x <= min(o, mx[a - 1][k - 1]); x++) {
            add(f[i][j][k], 1ll * f[a - 1][x][k - 1] * f[i - a][o - x][k - 1] %
                                P * C[i - 1][a - 1] % P);
          }
        }
        if (f[i][j][k]) mx[i][k] = j;
      }
    }
  }
  cout << f[n][s][m] << endl;
  return 0;
}

```