#include <iostream>
#include <vector>
#include <queue>
#include <tuple>
#include <cmath>
#include <algorithm>
using namespace std;

int K, N, M;
int A[100005];
typedef tuple<long long, int, int> P;// (error, original-index, scaled-value)
P Q[100005], R[100005];

int main() {
  scanf("%d%d%d", &K, &N, &M);
  for (int i = 0; i < K; i++) { scanf("%d", A+i); }

  double r = (double) M / (double) N;
  for (int i = 0; i < K; i++) {
    int scaled = (int)ceil(A[i] * r);
    Q[i] = make_tuple(abs((long long)N*scaled - (long long)M*A[i]), i, scaled);
  }

  int rest = 0; // to decrease
  for (int i = 0; i < K; i++) { rest += get<2>(Q[i]); }
  rest -= M;

  sort(Q, Q+K, [](P &a, P &b) {
    return get<0>(a) > get<0>(b);
  });
  for (int i = 0; i < rest; i++) {
    Q[i] = make_tuple(get<0>(Q[i]), get<1>(Q[i]), get<2>(Q[i])-1);
  }

  sort(Q, Q+K, [](P &a, P &b) {
    return get<1>(a) < get<1>(b);
  });
  for (int i = 0; i < K; i++) { printf("%d ", get<2>(Q[i])); }
  puts("");
}

#include <bits/stdc++.h>

#define int ll

typedef long long ll;

const int K = 100000;

int k, n, m;

ll a[K + 5]; int l[K + 5], r[K + 5];
bool check(ll x) {
	ll sl = 0, sr = 0;
	for (int i = 1; i <= k; i++) {
		if (a[i] - x > 0) l[i] = (a[i] - x + n - 1) / n;
		else l[i] = 0;
		r[i] = (a[i] + x) / n;

		sl += l[i], sr += r[i];
	}
	return sl <= m && m <= sr;
}

ll sl[K + 5], sr[K + 5]; int ans[K + 5];
void print(ll x) {
	// printf("! %lld\n", x);
	for (int i = 1; i <= k; i++) {
		if (a[i] - x > 0) l[i] = (a[i] - x + n - 1) / n;
		else l[i] = 0;
		r[i] = (a[i] + x) / n;

		sl[i] = sl[i - 1] + l[i], sr[i] = sr[i - 1] + r[i];
	}
	for (int i = k; i >= 1; i--) {
		if (m - l[i] <= sr[i - 1]) {
			ans[i] = l[i], m -= l[i];
		} else {
			ans[i] = m - sr[i - 1];
			for (int j = i - 1; j >= 1; j--)
				ans[j] = r[j];
			break;
		}
	}
	for (int i = 1; i <= k; i++)
		printf("%lld ", ans[i]);
	puts("");
}

signed main() {
	scanf("%lld%lld%lld", &k, &n, &m);
	for (int i = 1; i <= k; i++)
		scanf("%lld", &a[i]), a[i] *= m;

	ll le = 0, ri = (ll)n * m;
	while (le < ri) {
		ll mid = (le + ri) >> 1;
		if (check(mid)) ri = mid;
		else le = mid + 1;
	}
	print(ri);
}