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

ll h, w, a, b;

ll count(vector<ll> mas, ll aed, ll bed, ll now){
  /*
  cout << now << endl;
  for(int i=0;i<w*h;i++) cout << mas[i] << " ";
  cout << endl;
  */
  
  if(aed<0 || bed<0) return 0;
  if(now == h*w) return 1;
  if(mas[now]!=0) return count(mas, aed, bed, now+1);
  
  mas[now]=1;
  ll c = count(mas, aed, bed-1, now+1);
  if((now+1)%w!=0 && mas[now+1]==0){
    mas[now+1] = 1;
    c += count(mas, aed-1, bed, now+1);
    mas[now+1] = 0;
  }
  if((now+w)<w*h){
    mas[now+w] = 1;
    c += count(mas, aed-1, bed, now+1);
    mas[now+w] = 0;
  }
  return c;
}
  
  

int main(){
  
  cin >> h >> w >> a >> b;
  vector<ll> A(w*h, 0);
  cout << count(A, a, b, 0) << endl;
  return 0;
}


#include <bits/stdc++.h>
#define LL long long
#define db double
#define mp make_pair
#define x first
#define y second
#define vi vector<int>
#define SZ(a) (int)((a).size())
using namespace std;
const int N = 1e5 + 10;
int k, n, m, id[N];
LL a[N], b[N], c[N];
 
int cmp(int x, int y) { return abs(c[x] - a[x]) < abs(c[y] - a[y]); }
 
void quit() {
	for(int i = 1; i <= k; i++) printf("%lld ", b[i] / n);
	printf("\n");
	exit(0); 
}
 
int main() {
	scanf("%d%d%d", &k, &n, &m);
	int L = 0, R = 0;
	for(int i = 1; i <= k; i++) {
		scanf("%lld", &a[i]);
		a[i] *= m;
		LL l = a[i] / n * n, r = (a[i] / n + 1) * n;
		if(abs(l - a[i]) > abs(r - a[i])) swap(l, r);
		L += l / n, R += l / n; 
		b[i] = l;
		c[i] = r;
		id[i] = i;
	}
	sort(id + 1, id + k + 1, cmp);
	if(L <= m && m <= R) quit();
	for(int i = 1; i <= k; i++) {
		int x = id[i];
		if(m < L) {
			if(c[x] > b[x]) continue;
			b[x] = c[x], L--;
		} else {
			if(c[x] < b[x]) continue;
			b[x] = c[x], R++;
		}
		if(L <= m && m <= R) quit();
	}
	return 0;
}