#include <bits/stdc++.h>
using namespace std;

#define ll long long

#define rep(i, n) for (ll i = 0; i < n; ++i)
#define rep_up(i, a, b) for (ll i = a; i < b; ++i)
#define rep_down(i, a, b) for (ll i = a; i > b; --i)

#define P pair<ll, ll>
#define Graph vector<vector<ll>>
#define fi first
#define se second

#define vvvvll vector<vector<vector<vector<ll>>>>
#define vvvll vector<vector<vector<ll>>>
#define vvll vector<vector<ll>>
#define vll vector<ll>

#define vvvvdo vector<vector<vector<vector<double>>>>
#define vvvdo vector<vector<vector<double>>>
#define vvdo vector<vector<double>>
#define vdo vector<double>

#define pqll priority_queue<ll>
#define pqllg priority_queue<ll, vector<ll>, greater<ll>>

constexpr ll INF = (1ll << 60);
// constexpr ll mod = 998244353;
constexpr ll mod = 1000000007;
constexpr double pi = 3.14159265358979323846;
template <typename T>
inline bool chmax(T &a, T b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <typename T>
inline bool chmin(T &a, T b) {
    if (a > b) {
        a = b;
        return 1;
    }
    return 0;
}

void pt_vvll(vvll v) {
    ll vs = v.size(), vs0 = v[0].size();
    rep(i, vs) {
        rep(j, vs0) {
            if (v[i][j] != INF)
                cout << v[i][j];
            else
                cout << -1;

            if (j != vs0 - 1)
                cout << " ";
            else
                cout << "\n";
        }
    }
}
void pt_vll(vll v) {
    ll vs = v.size();
    rep(i, vs) {
        cout << v[i];
        if (i == vs - 1)
            cout << "\n";
        else
            cout << " ";
    }
}

void make_prime(vector<ll> &ret, ll n) {
    ll x = n;
    for (ll i = 2; i * i <= x; i++) {
        while (n % i == 0) {
            n /= i;
            ret.push_back(i);
        }
    }
    if (n != 1) {
        ret.push_back(n);
    }

    return;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    ll N;
    cin >> N;
    vll a(N);
    rep(i, N) cin >> a[i];

    vll ans;
    rep(i, N - 1) {
        if (a[i] < a[i + 1]) continue;

        ll see = i + 1;
        while ((see != 0 && a[see] < a[see - 1])) {
            ans.push_back(see - 1);
            swap(a[see], a[see - 1]);
            if (ans.size() >= N) {
                cout << -1 << "\n";
                return 0;
            }
            see--;
            if (see == 0) break;
        }
    }
    // pt_vll(ans);

    if (ans.size() != N - 1) {
        cout << -1 << "\n";
        return 0;
    }
    vector<bool> used(N - 1);
    rep(i, N - 1) {
        if (!used[i])
            used[i] = true;
        else {
            cout << -1 << "\n";
        }
    }

    rep(i, N - 1) { cout << ans[i] + 1 << "\n"; }
    return 0;
}


#include "bits/stdc++.h"
using namespace std;
int h, w, a, b;
long long dp[1 << 16][9];
bool ok[16];
void solution() {
  cin >> h >> w >> a >> b;
  int mx = h * w;
  for (int i = 0; i < mx; i ++) {
    if ((i + 1) % w == 0) ok[i] = false;
    else ok[i] = true;
  }
  dp[0][0] = 1;
  for (int msk = 0; msk < (1 << mx); msk ++) {
    int fbit;
    for (int i = 0; i < mx; i ++) if (!(msk >> i & 1)) {
      fbit = i;
      break;
    }
    for (int alr = 0; alr <= a; alr ++) {
      dp[msk ^ (1 << fbit)][alr] += dp[msk][alr];
      if (alr < a) {
        if (ok[fbit] && !(msk >> (fbit + 1) & 1)) 
          dp[msk ^ (1 << fbit) ^ (1 << (fbit + 1))][alr + 1] += dp[msk][alr];
        if (fbit < mx - w && !(msk >> (fbit + w) & 1)) {
          dp[msk ^ (1 << fbit) ^ (1 << (fbit + w))][alr + 1] += dp[msk][alr];
        }
      }
    }
  }
  cout << dp[(1 << mx) - 1][a];
}
signed main() {
  ios_base::sync_with_stdio(0); cin.tie(0); int tc = 1;
#ifdef DEBUG  
  freopen("input.txt", "r", stdin); 
#endif
  // cin >> tc;
  while (tc --) { solution(); cout << "\n"; }
}