#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template<class T> using vc = vector<T>;
template<class T> using vvc = vc<vc<T>>;
template<class T> using vvvc = vc<vvc<T>>;
template<class T> using vvvvc = vvc<vvc<T>>;
template<class T> using PQ = priority_queue<T>;
template<class T> using invPQ = priority_queue<T, vector<T>, greater<T>>;
using IP = pair<int, int>;
using LP = pair<ll, ll>;
#define all(x) begin(x), end(x)
#define rep(i, n) for (int i = 0; (i) < (int)(n); i++)
#define rep3(i, m, n) for (int i = (m); (i) < (int)(n); i++)
#define repr(i, n) for (int i = (n) - 1; (i) >= 0; i--)
#define rep3r(i, m, n) for (int i = (n) - 1; (i) >= (int)(m); i--)
template<class T> inline bool chmax(T & a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T & a, T b) { if (a > b) { a = b; return 1; } return 0; }

signed main() {
    ios::sync_with_stdio(0);
    cin.tie(0);

    ll K, N, M;
    cin >> K >> N >> M;
    vc<ll> A(K);
    rep (i, K) cin >> A[i];

    vc<tuple<long double, ll, ll>> cond;
    int cnt = 0;
    rep (i, K) {
        int b = M*A[i]/N;
        cnt += b;
        cond.push_back({ (long double)b/M - (long double)A[i]/N, i, M*A[i]/N });
    }
    sort(cond.begin(), cond.end());
    rep (i, K) {
        if (cnt >= M) break;
        get<2>(cond[i])++;
        get<0>(cond[i]) = (long double)get<2>(cond[i])/M;
        cnt++;
    }

    vc<int> B(K);
    rep (i, K) {
        B[get<1>(cond[i])] = get<2>(cond[i]);
    }
    rep (i, K) {
        if (i != 0) cout << " ";
        cout << B[i];
    }
    cout << endl;

}
#include <bits/stdc++.h>
// #define x first
// #define y second
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
using namespace std;

typedef long long LL;
typedef pair<int, int> PII;
const int N = 1e5 + 20;

int n, m, k;
LL a[N], b[N], c[N], mi[N], mx[N];

bool check(LL mid)
{
	for(int i = 1; i <= k; ++ i)
	{
		mx[i] = min((a[i] + mid) / n, (LL)m) + mx[i - 1];
		mi[i] = max(0ll, (a[i] - mid + n - 1) / n) + mi[i - 1];
	}
	return mi[k] <= m && mx[k] >= m;
}

int main()
{
	IOS; cin >> k >> n >> m;
	for(int i = 1; i <= k; ++ i) cin >> a[i], a[i] *= m;
	
	LL l = 0, r = 1e18;
	while(l <= r)
	{
		LL mid = l + r >> 1;
		if(check(mid))
		{
			memcpy(b, mx, sizeof b), memcpy(c, mi, sizeof c);
			r = mid - 1;		
		}
		else l = mid + 1;
	}
	for(int i = k; i >= 1; -- i)
	{
		a[i] = min(m - c[i - 1], b[i] - b[i - 1]);
		m -= a[i];
	}
	for(int i = 1; i <= k; ++ i) cout << a[i] << " ";
	return 0;
}