#include <bits/stdc++.h>
// #include <atcoder/all>
#include <cmath>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
const ll INFI = 1001001001;
const ll INFL = 1001001001001001001;
const ll MOD = (int)1e9 + 7;
const double EPS = 1e-9;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
typedef pair<ll, ll> P;
#define rep(i, n) for (ll i = 0; i < n; i++)
#define FOR(i, in, fn) for (ll i = in; i <= fn; i++)
#define debug(x) cerr << #x << ": " << x << endl

void sort2vectors(vector<ll> &av, vector<ll> &bv)
{
    int n = av.size();
    vector<ll> p(n), av2(n), bv2(n);
    iota(p.begin(), p.end(), 0);
    sort(p.begin(), p.end(), [&](ll a, ll b) { return av[a] < av[b]; });
    for (int i = 0; i < n; i++)
    {
        av2[i] = av[p[i]];
        bv2[i] = bv[p[i]];
    }
    av = av2;
    bv = bv2;
}

int main()
{
    long long K;
    scanf("%lld", &K);
    long long N;
    scanf("%lld", &N);
    long long M;
    scanf("%lld", &M);
    std::vector<long long> A(K), A2(K), num(K);
    std::vector<long long> B(K), sa(K);
    for (int i = 0; i < K; i++)
    {
        scanf("%lld", &A[i]);
    }

    ll sum = 0;
    rep(i, K)
    {

        A2[i] = A[i];
        num[i] = i;
        B[i] = M * A[i] / N;
        sum += B[i];
        //debug(B[i]);
        sa[i] = (llabs((B[i] + 1) * N - A[i] * M)) - (llabs(B[i] * N - A[i] * M));
        //debug(sa[i]);
    }
    ll amari = M - sum;
    sort2vectors(sa, num);
    rep(i, amari)
    {
        B[num[i]]++;
    }
    rep(i, K)
    {
        cout << B[i] << " ";
    }
    cout << endl;
    return 0;
}

#include <bits/stdc++.h>

template <class T>
inline void read(T &x) {
	static char ch; 
	static bool opt; 
	while (!isdigit(ch = getchar()) && ch != '-'); 
	x = (opt = ch == '-') ? 0 : ch - '0'; 
	while (isdigit(ch = getchar()))
		x = x * 10 + ch - '0'; 
	if (opt)
		x = ~x + 1; 
}

template <class T>
inline void putint(T x) {
	static char buf[45], *tail = buf; 
	if (!x)
		putchar('0'); 
	else {
		if (x < 0)
			putchar('-'), x = ~x + 1; 
		for (; x; x /= 10) *++tail = x % 10 + '0'; 
		for (; tail != buf; --tail) putchar(*tail); 
	}
}

template <class T>
inline bool tense(T &x, const T &y) {
	return y < x ? x = y, true : false; 
}

template <class T>
inline bool relax(T &x, const T &y) {
	return x < y ? x = y, true : false; 
}

template <class T>
inline T getAbs(const T &x) {
	return x < 0 ? -x : x; 
}

typedef long long s64; 
typedef long double ld; 
typedef std::vector<int> vi; 
typedef std::pair<int, int> pii; 
#define mp(x, y) std::make_pair(x, y)

using std::cerr; 

const int MaxN = 1e5 + 5; 
const s64 INFs64 = 1LL << 60; 

int n, m, K, a[MaxN], b[MaxN]; 

s64 pre[MaxN][2]; 

inline bool check(s64 mid) {
	for (int i = 1; i <= K; ++i) {
		s64 l = 0, r = m; 
		tense(r, (1LL * a[i] * m + mid) / n); 
		if (1LL * a[i] * m > mid)
			relax(l, (1LL * a[i] * m - mid - 1) / n + 1); 
		
		pre[i][0] = pre[i - 1][0] + l; 
		pre[i][1] = pre[i - 1][1] + r; 

		// cerr << l << ' ' << r << '\n'; 
	}
	return m >= pre[K][0] && m <= pre[K][1]; 
}

inline s64 findBest() {
	s64 l = 0, r = 1e18, mid, res = 1e18; 
	while (l <= r) {
		mid = (l + r) >> 1; 
		if (check(mid))
			res = mid, r = mid - 1; 
		else
			l = mid + 1; 
	}
	return res; 
}

int main() {
#ifdef orzczk
	freopen("a.in", "r", stdin); 
#endif

	read(K), read(n), read(m);
	for (int i = 1; i <= K; ++i) {
		read(a[i]); 
	}

	s64 best = findBest(); 

	// cerr << best << '\n'; 
	check(best); 

	for (int i = K, cur = m; i >= 1; --i) {
		s64 l = 0, r = m; 
		tense(r, (1LL * a[i] * m + best) / n); 
		if (1LL * a[i] * m > best)
			relax(l, (1LL * a[i] * m - best - 1) / n + 1); 
		
		tense(r, cur - pre[i - 1][0]); 
		relax(l, cur - pre[i - 1][1]); 

		b[i] = l; 
		cur -= b[i]; 
	}
	for (int i = 1; i <= K; ++i) {
		printf("%d%c", b[i], " \n"[i == K]); 
	}

	return 0; 
}