#include<bits/stdc++.h> 
using namespace std;
typedef long long ll;
#define all(x) (x).begin(),(x).end()
template<typename T1,typename T2> bool chmin(T1 &a,T2 b){if(a<=b)return 0; a=b; return 1;}
template<typename T1,typename T2> bool chmax(T1 &a,T2 b){if(a>=b)return 0; a=b; return 1;}
int dx[4]={0,1,0,-1}, dy[4]={1,0,-1,0};
long double eps = 1e-9;
long double pi = acos(-1);


signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(20);

    ll k,n,m;
    cin>>k>>n>>m;
    ll a[k];
    for(int i=0;i<k;i++)cin>>a[i];
    array<ll,2> ans[k]={};
    ll sum = 0;
    array<ll,2> dif[k]={};
    for(int i=0;i<k;i++){
        ans[i][0] = m*a[i]/n;
        ans[i][1]=i;
        sum += ans[i][0];
        dif[i][1]=i;
        dif[i][0] = abs(n*(ans[i][0]+1LL)-m*a[i]) - abs(n*ans[i][0]-m*a[i]);
    }
    ll rem = m - sum;
    sort(dif,dif+k);
    ll ret[k]={};
    for(int i=0;i<rem;i++){
        ret[dif[i][1]]++;
    }
    for(int i=0;i<k;i++)ret[ans[i][1]]+=ans[i][0];
    for(int i=0;i<k;i++){
        cout << ret[i] << " ";
    }
    cout << endl;
}
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <iostream>
#define ll long long
using namespace std;
int k;ll n,m,a[100010],ans[100010],l[100010],r[100010],le,ri;
bool check(ll x)
{
	le=0,ri=0;
	for(int i=1;i<=k;i++)
	{
		r[i]=(x+a[i])/n;
		if(a[i]<=x) l[i]=0;
		else l[i]=((a[i]-x)%n==0)?(a[i]-x)/n:(a[i]-x)/n+1;
		le+=l[i],ri+=r[i];
		if(r[i]<l[i])
			return false;
	}
	if(le>m||ri<m) return false;
	for(int i=1;i<=k;i++)
	{
		if(r[i]-l[i]+le<=m)
			ans[i]=r[i],le+=r[i]-l[i];
		else
			ans[i]=l[i]+m-le,le=m;
	}
	return true;
}
int main()
{
	scanf("%d %lld %lld",&k,&n,&m);
	for(int i=1;i<=k;i++)
		scanf("%lld",&a[i]);
	for(int i=1;i<=k;i++)
		a[i]*=m;
	ll l=0,r=1e18;
	while(l<=r)
	{
		ll mid=l+r>>1;
		if(check(mid))
			r=mid-1;
		else
			l=mid+1;
	}
	for(int i=1;i<=k;i++)
		printf("%lld ",ans[i]);
}