#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll K,n,m,a[100005],b[100005],sl[100005],sr[100005];
bool Check(ll mid){
	for(int i=1;i<=K;i++){
		ll l=a[i]-mid,r=a[i]+mid;
		//cout<<i<<' '<<a[i]+mid<<' '<<r<<' '<<'\n';
		l=(l+n-1)/n,r=r/n;
		//cout<<i<<' '<<a[i]+mid<<' '<<r<<' '<<'\n';
		l=max(l,0ll),r=min(r,m);
		//cout<<i<<' '<<a[i]+mid<<' '<<r<<' '<<'\n';
		if(l>r)return 0;
		sl[i]=sl[i-1]+l,sr[i]=sr[i-1]+r;
		//cout<<i<<' '<<a[i]+mid<<' '<<n<<' '<<sl[i]<<' '<<sr[i]<<'\n';
	}
	if(sl[K]>m||sr[K]<m)return 0;
	ll tm=m;
	for(int i=1;i<=K;i++){
		ll tl=sl[K]-sl[i],tr=sr[K]-sr[i];
		ll l=a[i]-mid,r=a[i]+mid;
		l=(l+n-1)/n,r=r/n;
		l=max(l,0ll),r=min(r,tm);
		b[i]=min(r,tm-tl);
		tm-=b[i];
	}
	return 1;
}
int main(){
	cin>>K>>n>>m;
	for(int i=1;i<=K;i++)cin>>a[i],a[i]*=m;
	//cout<<Check(70)<<'\n';
	//cout<<Check(34)<<'\n';
	//return 0;
	ll l=0,r=n*m,ans=0;
	while(l<=r){
		ll mid=(l+r)/2;
		if(Check(mid))ans=mid,r=mid-1;
		else l=mid+1;
		//cout<<l<<' '<<r<<' '<<mid<<' '<<ans<<'\n';
	}
	Check(ans);
	for(int i=1;i<=K;i++)cout<<b[i]<<' ';
}

#include <bits/stdc++.h>

int main(){
    int K, N, M;
    std::cin >> K >> N >> M;
    std::vector< long long > A(K);
    for(int i=0; i<K; i++){
        std::cin >> A[i];
    }
    
    std::vector< long long > B(K);
    std::vector< std::pair< long long, long long > > B_zan_i(K);
    long long total = 0;
    for(int i=0; i<K; i++){
        B[i] = A[i] * M / N;
        total += B[i];
        B_zan_i[i].first = (A[i] * M) % N;
        B_zan_i[i].second = i;
    }
    
    std::sort(B_zan_i.begin(), B_zan_i.end());
    for(int i=0; i<M-total; i++){
        B[B_zan_i[K - i - 1].second]++;
    }
    
    for(int i=0; i<K; i++){
        if(i == K-1){
            std::cout << B[i] << std::endl;
        }else{
            std::cout << B[i] << " ";
        }
    }
    
    return 0;
}

