#include<stdio.h>
#include<iostream>
#include<vector>
#include<math.h>
#include<queue>
#include<map>
#include<algorithm>
#include<string.h>
#include<functional>
#include<limits.h>
#include<stdlib.h>
#include<string>
#include<unordered_map>
#include <iomanip>
using namespace std;

#define intmax INT_MAX
#define lmax LONG_MAX
#define uintmax UINT_MAX
#define ulmax ULONG_MAX
#define llmax LLONG_MAX
#define ll long long
#define rep(i,a,N) for((i)=(a);(i)<(N);(i)++)
#define rrp(i,N,a) for((i)=(N)-1;(i)>=(a);(i)--)
#define llfor ll i,j,k
#define sc(a) cin>>a
#define pr(a) cout<<a<<endl
#define pY puts("YES")
#define pN puts("NO")
#define py puts("Yes")
#define pn puts("No")
#define pnn printf("\n")
#define sort(a) sort(a.begin(),a.end())
#define reverse(a) reverse(a.begin(),a.end())
#define push(a,b) (a).push_back(b)
#define llvec vector<vector<ll>>
#define charvec vector<vector<char>>
#define sizeoof(a,b) (a,vector<ll>(b))
#define llpvec vector<pair<ll,ll>>
/*繰り上げ除算*/ll cei(ll x,ll y){ll ans=x/y;if(x%y!=0)ans++;return ans;}
/*最大公約数*/ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}
/*最小公倍数*/ll lcm(ll x,ll y){return x/gcd(x,y)*y;}
/*n乗*/ll llpow(ll x,ll n){ll i,ans=1;rep(i,0,n)ans*=x;return ans;}
/*階乗*/ll fact(ll x){ll i,ans=1;rep(i,0,x)ans*=(x-i);return ans;}
/*nCr*/ll ncr(ll n,ll r){return fact(n)/fact(r)/fact(n-r);}
/*nPr*/ll npr(ll n,ll r){return fact(n)/fact(n-r);}
/*primejudge*/bool prime(ll a){if(a<=1)return false;ll i;for(i=2;i*i<=a;i++){if(a%i==0)return false;}return true;}
ll ans=0;llfor;///////////////////////////////////////////////////////////
int main(){
  int K;
  ll N,M,count=0;
  cin>>K>>N>>M;
  vector<ll> A(K+10);
  //vector<ll> B(K+10);
  vector<ll> C(K+10);
  vector<ll> D(K+10);
  vector<ll> E(K+10);
  for(int i=0;i<K;i++){
    int X;
    cin>>X;
    A[i]=M*X;
    C[i]=A[i]/N*N;
    count+=C[i]/N;
  }
  count=M-count;
  for(int i=0;i<K;i++){
    D[i]=abs(A[i]-C[i]);
    E[i]=D[i];
  }
  sort(D);
  reverse(D);
  for(int j=0;j<count;j++){
    for(int i=0;i<K;i++){
      if(D[j]==E[i]){
        C[i]+=N;
        E[i]=abs(E[i]-N);
        break;
      }
    }
  }
  for(int i=0;i<K;i++){
    cout<<C[i]/N<<" ";
  }
return 0;}

#include <bits/stdc++.h>
using namespace std;
template <typename T> void read(T &t) {
	t=0; char ch=getchar(); int f=1;
	while (ch<'0'||ch>'9') { if (ch=='-') f=-1; ch=getchar(); }
	do { (t*=10)+=ch-'0'; ch=getchar(); } while ('0'<=ch&&ch<='9'); t*=f;
}
typedef long long ll;
const ll INF=1e18;
const int maxn=(1e5)+10;
int K;
ll n,m,a[maxn],L[maxn],R[maxn];
ll UP(ll x,ll y) {
	if (x%y==0) return x/y;
	return x/y+1;
}
ll suf[maxn];
bool solve(ll mid,bool flag) {
	ll s1=0,s2=0;
	for (int i=1;i<=K;i++) {
		L[i]=UP(max(0LL,m*a[i]-mid),n);
		R[i]=(mid+m*a[i])/n;
		if (L[i]>R[i]) return 0;
		s1+=L[i],s2+=R[i];
	}
	if (!flag) return s1<=m&&m<=s2;
	for (int i=K;i>=1;i--) {
		suf[i]=suf[i+1]+R[i];
		suf[i]=min(suf[i],INF);
	}
	ll sum=0,tmp;
	for (int i=1;i<=K;i++) {
		if (sum+suf[i+1]+L[i]>=m) tmp=L[i];
		else tmp=m-(sum+suf[i+1]);
		printf("%lld ",tmp);
		sum+=tmp;
	}
	puts("");
	return 1;
}
int main() {
//	freopen("1.txt","r",stdin);
	read(K);
	read(n),read(m);
	for (int i=1;i<=K;i++) read(a[i]);
	ll l=0,r=INF,res,mid;
	while (l<=r) {
		mid=(l+r)>>1;
		if (solve(mid,0)) res=mid,r=mid-1;
		else l=mid+1;
	}
	solve(res,1);
	
	return 0;
}
/*
  REMEMBER:
  1. Think TWICE, Code ONCE!
  Are there any counterexamples to your algo?
    
  2. Be careful about the BOUNDARIES!
  N=1? P=1? Something about 0?
    
  3. Do not make STUPID MISTAKES!
  Array size? Integer overflow? Time complexity? Memory usage? Precision error?
*/