#include<bits/stdc++.h>
#define ll long long int
#define pll pair<ll,ll>
#define vpll vector< pll >
#define mpll map<ll,ll>
#define MOD 1000000007
#define all(v) v.begin(),v.end()
#define s(v) v.size()
#define test ll t;cin>>t;while(t--)
#define vec vector<ll>
#define read0(v,n) for(int i=0;i<n;i++)cin>>v[i];
#define read1(v,n) for(int i=1;i<=n;i++)cin>>v[i];
#define trav(a,x) for (auto& a: x)
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
#define cut(x) {cout<<x;return 0;}
#define print(x) {cout<<x<<nl;continue;}
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define FORB(i,a,b) for(int i=a;i>=b;i--)
#define err1(a) {cout<<#a<<' '<<a<<nl;}
#define err2(a,b) {cout<<#a<<' '<<a<<' '<<#b<<' '<<b<<nl;}
#define mem(a,b) memset(a,b,sizeof(a))

#define mp make_pair
#define pb push_back
#define eb emplace_back
#define f first
#define sc second
#define lb lower_bound
#define ub upper_bound
#define nl '\n'
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
using namespace std;
#define oset tree<int, null_type,less_equal<int>, rb_tree_tag,tree_order_statistics_node_update>
ll gcd(ll a, ll b)
{
	if (b==0)return a;
	return gcd(b, a % b);
}
ll lcm(ll a,ll b)
{
    return (a*b)/gcd(a,b);
}
ll bpow(ll a, ll b)
{
	ll ans=1;
	while(b)
	{
		if(b&1)
			ans=(ans*a)%MOD;
		b/=2;
		a=(a*a)%MOD;
	}
	return ans;
}

int main()
{
	#ifndef ONLINE_JUDGE
    	freopen("input.txt", "r", stdin);
    	freopen("output.txt", "w", stdout);
    	#endif

	fast
	ll k,n,m;
	cin>>k>>n>>m;
	vec a(k),b(k);
	read0(a,k);
	FOR(i,0,k-1)a[i]*=m;
	ll tot=0;
	set<pll> diff;
	FOR(i,0,k-1)
	{
	    b[i]=a[i]/n;
	    tot+=b[i];
	    diff.insert({a[i]-b[i]*n,i});
	}
	tot=m-tot;
	while(tot--)
    {
        pll p=*diff.rbegin();
        diff.erase(prev(diff.end()));
        b[p.sc]++;
    }
    trav(it,b)cout<<it<<' ';cout<<nl;
}

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <map>
using namespace std;
#define MOD @
#define ADD(X,Y) ((X) = ((X) + (Y)%MOD) % MOD)
typedef long long i64; typedef vector<int> ivec; typedef vector<string> svec;

int K, N, M;
int A[101010];

i64 rceil(i64 a, i64 b) {
	if (a < 0) return 0;
	return (a - 1) / b + 1;
}

vector<i64> solve(i64 df) {
	vector<i64> low, high;
	for (int i = 0; i < K; ++i) {
		// -df <= N * x - M * A[i] <= df

		low.push_back(rceil((i64)M * A[i] - df, N));
		high.push_back(((i64)M * A[i] + df) / N);
	}

	i64 ls = 0, hs = 0;
	for (int i = 0; i < K; ++i) {
		if (low[i] > high[i]) return {};
		ls += low[i];
		hs += high[i];
	}
	if (!(ls <= M && M <= hs)) return {};

	i64 ext = M - ls;
	vector<i64> ret;
	for (int i = 0; i < K; ++i) {
		i64 v = low[i] + min(high[i] - low[i], ext);
		ext -= v - low[i];
		ret.push_back(v);
	}
	return ret;
}

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

	i64 lf = 0, rg = 1LL << 60LL;
	while (lf < rg) {
		i64 mid = (lf + rg) / 2;
		if (solve(mid).size() > 0) {
			rg = mid;
		} else {
			lf = mid + 1;
		}
	}
	auto ans = solve(lf);
	for (int i = 0; i < K; ++i) printf("%lld%c", ans[i], i == K - 1 ? '\n' : ' ');
	return 0;
}
